Solving Equations in Perl [closed] - perl

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
How should I solve my equations in Perl?
I know binary search is one solution (and perhaps pretty fast for my equations) but I would like to know if there is a ready to use solutions such as math packages or libraries so that I can use them instead of implementing my own solver?
NOTE:
This is, find x for a given y.
The functions are strictly increasing
The equations usually look like: y = a + b*sqrt(x) + b*x or y = sqrt(a*(x-b)**2*(x-c)/(x-d))
Please don't complain that "this is off topic" or "you should ask this in http://math.stackexchange.com". I want to see this problem from the programming point of view, particularly in Perl!

Have you considered using libraries? There's Math::LP, for instance.
See the Perl and Math tutorial from PerlMonks for more info.

Search for symbolic math on MetaCPAN. Lots of interesting looking options.
https://metacpan.org/search?q=symbolic+math

Related

What is the matrix diagonalization precision in matlab? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 years ago.
Improve this question
I don't know what kind of algorithm it runs in the background but it seems that it cannot handle matrices which contain elements on the order of 10^-5.
It can handle upto 16 digits. Type:
format long;
a = 1.234567890123456;
in your MATLAB code or command window.
4 decimal places is the limit of format short.

Understanding term deterministic and non random [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 5 years ago.
Improve this question
I am confused about a situation which is presented on the following slide:
Last sentences says that:
It is important to note that deterministic does not mean that
xt is non-random. What does this mean? If A and B are random variable, then x must be random right?
I think the point may be that nature may choose randomly among different paths, but once you know which path has been chosen you can predict future values of x_t on the path from past values x_{t-1}, etc. So e.g. nature may flip a coin to choose between the following two paths: x_t=0 for all t, and x_t=1 for all t. Then if you don't know the path, x_t is indeed random. But once you know x_{t-1}, you know x_t.

Optimizing total number of cables [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I need lots of cables of different small sizes (under 100 meters) and cables are only sold in lenghts of 100 meters.
So, to optimize my purchase, I would like a code where I can input the lengths of all pieces of cables that I need. The code will combine my inputs under the constraint the sum is under 100, while minimizing the total number of 100m-length cables that I need to buy.
If anyone could help with a code in VBA, Matlab or Python I would be very grateful.
This is known as a bin-packing problem, and it's actually very difficult (computationally speaking) to find the optimal solution.
However, it is a problem that is practically useful to solve (as you have seen for yourself) and so there are several approaches that seek to find an approximate solution--one that is "good enough" without guaranteeing that it's the best possible solution. I did a quick search and found this course website, which has some examples that may help you out.
If you are looking for an exact solution, you can ask the related question "will I be able to fit the cables I need into N 100-meter cables?". This feasibility problem can be expressed as a "binary program", which is a special case of a "mixed-integer linear program", for which MATLAB has a solver called intlinprog (requires the optimization toolbox).
I'm sorry that I don't have any code to solve your problem, but I hope that this at least gives you some keywords to help you find more resources!
I believe this is like the cutting stock problem. There are some very good methods to solve this. Here is an implementation and some background. It is not too difficult to write an Excel front-end for this (see here).
If you google for "cutting stock problem" you will find lots of references.

How to Test conditional independence between random variables using available samples? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
How can I test for the independence between two random variable given another one(i.e. whether P(A|C)=P(A|C,B) or not?) using available samples. in other words, I just have 1000 samplesf for 3 random variables generated by bntoolbox on Matlab and now I wanna test for CI between arbitrary random variables.
I've read something about Fisher's method but honestly don't understand it.
Thanks is advance.

Reading a 5-D double data structure in matlab [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
How do I read a 5-D data structure (of type double) in matlab? I have loaded the data in matlab and it says 5-D double. How do I read it afterwards
With the current information I cannot say much, but usually this is a good first try:
In matlab navigate to the file, right click on it and choose import data.
The import wizard is quite powerful so you have a good chance to get the data you need from that. Afterwards you may need to try help reshape if it does not have the right dimensions yet.