Your Favorite Math Program



#41

For some time I've been a Mathematica user, have had to use MATLAB for work purposes. Just recently I started using Scientific Workplace, an outstanding math word processor coupled with the MuPAD computer algebra system. The new version 5.5 is superb, very useful, powerful, and easy to use. It made me wonder, what are others using, for what purpose, how do you rate them?


#42

I use MATLAB. There is a wealth of toolboxes and books written for and about MATLAB. Also the MathWorks toolboxes are very powerful. It took me a little while to get the hang of vector/matrix programming, but now I can think using that paradigm.


#43

Namir, did you buy any books to help you learn MATLAB? I need to know that program better, and would like any recommendations you might have.

#44

I'm a mathematical dilettante. I want to push past my hazy freshman's understanding of mathematics mostly for fun. You don't often use mathematical analysis in software systems design. Statistics is another matter. For that, there is GNU R, which is S on steroids and Free software.

I started my career in computers at UCSB Physics back in 1986. There I watched Mathematica take academia by storm when it was first released. That was 1989 or so. (The Physics department was also running Macsyma on Eunice, on a VAX. If you know what all that means, I'd like to talk to you.) I stopped working in Academia in 1992, and I've never gone back. So I miss those great academic discounts, among other things.

Checking out Mackichan Software's site, I see they are priced competitively to Mathematica, but still out of my reach for the whole bundle. However, "Scientific Notebook," Which appears to be Scientific Workplace minus the LaTeX output, is reasonable, at $222.00 for a commercial license. The student proce of $100.00 is more attractive, and better fits the use I would put the software to, but alas, I don't have a student ID. But the clincher for me is the lack of Linux support. I won't embark on projects that tie me to Windows, if I can help it. And since I want to use the software for recreation/education, I can certainly help it in this case.

My other alternative is to go back to poking at MuPAD in its no-cost form. I recall the interface wasn't all that bad.


#45

$222 for Scientific Notebook is $1658 less than Mathematica, priced off Wolfram's website. Mackichan also lets you load the program on multiple computers, whereas Wolfram extorts megabucks for additional platform you want. Your pocketbook is screaming to you...

#46

Howard, check out Octave: http://www.octave.org.

Best,

--- Les


#47

Hi all. Hi Howard, Les.
Octave is good...

DW

#48

Hello Claudius,

please try to solve with the new version of your math tool my "sceptical-killer" equation:


3*X+1/(X-5)=15+1/(X-5)

and SOLVE for X

(X=5 is a "bad" solution!!!)

Thank you!

Csaba

Ps.: I use my own routines for small applications, and the Matlab 6.5 for numerical simulations and Maple 7 for my own passions... ;)


#49

Tizedes' acid test of a solver is:

Quote:
3*X+1/(X-5)=15+1/(X-5)

and SOLVE for X

(X=5 is a "bad" solution!!!)


Certainly, neither side of the equation can be evaluated at X = 5. However, it can be stated that

3*X + 1/(X-5) = 15 + 1/(X-5) (X != 5)

=> 3*X + 1/(X-5) - [15 + 1/(X-5)] = 0 (X != 5)

lim {3*X + 1/(X-5) - [15 + 1/(X-5)]}
X->5

= lim [3*X - 15 + 1/(X-5) - 1/(X-5)]
X->5

= 3*5 - 15 + lim [1/(X-5) - 1/(X-5)]
X->5

= 15 - 15 + 0

= 0

That is, if the expressions are combined by subtracting the expressions from each other, the singular terms cancel each other out in the limit case.

Similarly, X = 0 is not a valid solution to the equation

sin(X)/X = 1

but the limit of sin(X)/X as X->0 is 1.

(Edited to rephrase the last part.)

-- KS

Edited: 5 Sept 2005, 7:23 p.m.


#50

Using limit laws:
lim_{x->5}(3x+1/(x-5))=lim_{x->5}(15+1/(x-5))

lim_{x->5}3x+1/(x-5)-(15+1/(x-5))

lim = 0

Correct. The algebraic isolation of x=5 is also 'correct' in manipulation of the original equation but since neither x={0,5} satisfy the equation there really is no solution and to my thinking is nonsensical. Definitely something I don't see every day.

There are bugs in every CAS, and it's not hard to get one to fail, even Mathematica. I've often wondered why those who always seem to come up with odd behavior/bugs in CASs don't work for the companies who make the programs.

Our european poster has put the problem before us to show how clever he is but has not given us the benefit of his ingenious solution. The next time I come in contact with our math Ph.D I'll put this before him, try to get a formal answer.


#51

Discontinuities...

Just a thought: All computational systems use either
binary or BCD DISCRETE NUMBER SYSTEM APPROXIMATIONS
to the "real number" line (not to mention i and the S-plane).

So all we are ever gonna get out of any program is
"approximate". Our computers are dealing with "DISCRETE
number system analogues" of the real mathematical "universe"...

No wonder the odd program "bombs", even if it IS Mathematica...

DW

#52

You can multiply both sides of the equation by (X-5), thus going from:

3*X+1/(X-5)=15+1/(X-5)

to:

3*X*(X-5) + 1 = 15*(X-5) + 1

which also gives:

(3*X - 15)*(X-5) = 0

and then:

3 * (X-5)^2 = 0

and then solve it. The solution is X = 5.

#53

Are you kidding? Any schoolchild can do this one, no CAS needed:

3x+(1/(x-5))=15+(1/(x-5)) =>
3x+(1/(x-5))-15-(1/(x-5))=0 =>
(3x+(1/(x-5))=15+(1/(x-5)))(x-5) =>
(x/(x-5))-(5/(x-5))-15x+3x²=15x-(5/(x-5))+(x/(x-5))-75 =>
(x/(x-5))-(5/(x-5))-15x+3x²-(15x-(5/(x-5))+(x/(x-5))-75 )=0 =>
3(x-5)²=0 =>
x=5

Yes, there is a singularity in the original equation, but the singularity exists on both sides of the equation, and cancels with simple multiplying through by the LCD and simplifying. All CASs I have solve x=5, and I see no bug here. Basically, you've submitted a nonsense example for what purpose?

Edited: 5 Sept 2005, 9:57 a.m.


#54

This is much simpler:

3*X + 1/(X-5) = 15 + 1/(X-5)

3*X + 1/(X-5) - 1/(X-5) = 15 + 1/(X-5) - 1/(X-5)

3*X = 15

X=5


#55

There you go! My approach would have restated the equation for a SOLVER to solve. We humans have a few million years of an evolutionary headstart so we can solve it on the fly. At least for the stated equation. Give us something like:

X = Ln(X^4)

And we have to resort to a calculator/computer.


#56

I took the initial equation to actually mean (from the context)

(3*x+1)/(x-5)=(15+1)/(x-5)

which makes a difference.


#57

Ambiguous, though, isn't it?


#58

Yes, it is!

#59

Very elegant equation ... elegant indeed.

#60

x = ln(x^4) becomes, for y=-ln(x) : -1/4=y*exp(y)

and this equation can be related to the definition of the Lambert 'W' function (see V.Abillo's excellent site for more) :

z=w.exp(w) <=> w=LambertW(z)

So y=LambertW(-1/4) and the final solution is :

x=exp(-LambertW(-1/4))

If the very useful LambertW function were present on the keyboard of our beloves calcs, this kind of problem would be straightforward. I have always believed that LambertW belongs there as well as Gamma, or even Sin and log.


#61

Hi, GE:

GE posted:

" This equation can be related to the definition of the Lambert 'W' function (see V. Albillo's excellent site for more) [...] If the very useful LambertW function were present on the keyboard of our beloved calcs, this kind of problem would be straightforward. I have always believed
that LambertW belongs there as well as Gamma, or even Sin and log."

Thanks for your kind comments. I do agree about Lambert's W, I think it actually belongs with the rest of usual transcendental functions. Of course, such well known functions as sin, cos, exp, and gamma do have thousands of applications where they're useful, but then they've been well known and studied for many centuries, while W's been under the limelight for only a handful of years.

Yet, more and more applications of W are being discovered continually, in a wide variety of engineering and mathematical fields, which only heightens its importance and further raises the general appreciation of its 'elementariness'.

As for it being included as a standard calculator function, I don't think this is likely to happen. Consider, for example, Bessel functions or elliptic functions. They do have tons of important applications, yet I've never seen a calculator with a built-in, keyboard elliptic sine. You get the regular 'circular' sine, and even the hyperbolic sine. But not the elliptic variety. So, Lambert's W isn't likely to make it.

That said, some HP models allow for user-defined functions that are as close as built-in in their handling as to be transparent to the user. For the HP-71B, for instance, you can enter:

    DEF FNW(X) = FNROOT(0,10,FVAR*EXP(FVAR)-X)
as a program line. Then, from the keyboard, you can use W(x) as easily as sin(x). Say,to solve:
     x^x = 5
you simply would key in:
     EXP(FNW(LN(5))) [ENTER]
which would promptly return to the display the value:
      2.12937248276 
which solves the equation. Notice that you've simply used FNW exactly as you use EXP or LN, i.e., as a built-in function, transparently to the user.

This is as near as it comes to have W directly in the keyboard.

Best regards from V.

#62

Quote:
If the very useful LambertW function were present on the keyboard of our beloves calcs

I'd vote for built-in hypergeometric function support; I find that useful more often than the Lambert W-Function. But I don't expect a dedicated key for it.

#63

"I, Claudius" posted,


Quote:
Are you kidding? Any schoolchild can do this one, no CAS needed:

Yes, there is a singularity in the original equation, but the singularity exists on both sides of the equation, and cancels with simple multiplying through by the LCD and simplifying. All CASs I have solve x=5, and I see no bug here. Basically, you've submitted a nonsense example for what purpose?


A long time ago, when I was around 10 years old, my retired-engineer grandfather showed me a algebraically-based "trick proof" that 0 = 1. At the time, I did not have the background to understand what the illegal step was.

I saw that example again, much later. The equations included a denominator term of X-1 that was introduced and later cancelled out. With X=1, though, a divide-by-zero had been performed, making the "proof" invalid.

Namir states in his example that x = 5 is an invalid solution to the problem. In the strictest sense, it is true that the expressions cannot be legally evaluated at x = 5. However, as I had pointed out earlier in the thread, it is true that the limit of the difference of the expressions as x-> 5 is zero.

Perhaps the CAS implementations are falling into the same trap -- performing algebraic steps without observing restrictions and without validating after-the-fact...

-- KS

Edited: 5 Sept 2005, 7:30 p.m.


#64

Hi all. Hi Karl.

Your replies to this thread are really cool.
Limits are where it's at...

I was hoping someone would remember that "proof" that 0=1.
A friend who did uni with me (both did engineering) showed me that one in high school...

Reminds me of the early part of "Hitch-hikers guide to the Galaxy" where Oolon Coluphids Theosophical blockbuster trilogy is being discussed. ("Having proved the non-existence of God, Man goes on to prove black is white and promptly gets himself killed on the next zebra crossing." [I do not believe in "God" in the conventional sense, btw.])

R.I.P. Doug, Bill and Dave... (You guys made a lt of poeple happy.)

DW

#65

Ah, yes, I remember that one, I fell for it hook, line and sinker as a kid:

Given a = b =>
a^2 = ab =>
a^2 - b^2 = ab - b^2 =>
(a + b)(a - b) = b(a - b) =>
a + b = b =>
a = 0 =>
If a = 1, then 1 = 0

While algebraically 'correct', one is lulled into forgetting that since a = b, a - b is zero, and one is dividing by zero, and is the fatal error.


#66

There's another one, which I think Karl had in mind.
I don't really remember it.


DW

#67

Hello Claudius,


I think this part is incorrect, but I see the joke in it... ;)

Quote:
a = b => a^2 = ab

Any place on Earth, any kind of mathematical education...

Thanks for response!
Csaba


#68

If a = b

Then a^2 = ab

Also b^2 = ab


There is nothing incorrect here. Now I'm beginning to see why the equation you submitted earlier as an indicator of bugs in CASs didn't pan out...

#69

Hi all,

This one's very good too. It's based on the same principle,
making people forget that you can't cross out a null factor, but here the factor's 'nullness' is even more concealed. Let's see:

Given that a = b + c, to try and prove that, indeed, a = b

  1. Initially, we have:
              a = b + c
  2. Multiplying both sides by (b-a):
              a * (b - a) = (b + c) * (b - a) 
  3. Expanding products:
              a * b - a * a = b * b - a * b + b * c - a * c
  4. Taking a * c to the other side:
              a * b - a * a + a * c = b * b - a * b + b * c
  5. Collecting terms:
              a * (b - a + c) = b * (b - a + c)
  6. Eliminating the common factor (b - a + c):
              a  = b
  7. Q.E.D.
The 'demonstration' is perfectly reversible, i.e., starting from
"a = b" and demonstrating that actually "a = b + c", but it's
simpler and more natural this way. When shown to the right people,
you can leave them profoundly confused and intrigued. All the mistery goes out when you supply actual numbers, though.

Best regards from V.

#70

Hi, all:

... and just to prove that not all fake demonstrations are
based in illegally dividing by zero, have a look at this very nice 'demonstration' that 3 = 2. Let's see:

  1. According to Calculus, the derivatives of f(x) = x^3 and f(x) = x^2 are, respectively:
         D[x^3] = 3*x^2  ,  D[x^2] = 2*x
  2. Also, we know from Calculus that the derivative of a sum of functions is the sum of the derivatives of each function being added, i.e.:
         D[f(x) + g(x) + ...] = D[f(x)] + D[g(x)] + ...
  3. Now, by definition, we have the identity:
         x^3 = x^2 * x = x^2 + x^2 + x^2 + ... + x^2 
    <---(x summands in all) -->
  4. Let's take derivatives in both sides of that identity:
         D[x^3] = D[x^2 + x^2 + ... + x^2]
  5. As the derivative of a sum is the sum of the derivatives, we have:
         D[x^3] = D[x^2] + D[x^2] + ... + D[x^2]
  6. According to (1) above, we then have:
          3*x^2 = 2*x + 2*x + 2*x + ... + 2*x
    <-- (x summands in all) -->

    = (2*x)*x

    = 2*x^2

  7. So, we've got that 3*x^2 = 2*x^2, which for general, non-null x implies that 3 = 2, Q.E.D.

Nice, uh ? And no divisions by 0 in sight ... Have your students try and pinpoint out what went wrong :-)

Best regards from V.


#71

That's easy if you look carefully at

x^2 + x^2 + x^2 + ... + x^2
<---(x summands in all) -->


and would maybe be even easier if it was written in sigma notation.

The number of terms in the sum *also* depends on x, not just the terms themselves. So, you also have to differentiate with respect to that "x", which was hidden.

Another type of false proof involves applying the inverse of a function that isn't 1-to-1 on both sides of an equation, but using different branches for each side. Eg.,

(-1) = (-1)
(-1)^2 = (-1)^2 = 1, so

(-1)^2 = 1

Taking squareroots cancels the square on the left, leaving

-1 = 1.

I've also seen a false geometrical proof that proves all angles are equal. The trick to that was drawing the picture slightly wrong, but so that the lines that are supposed to be congruent *look* about the same. Some steps in the "proof" were made by appealing to the picture, rather than rigorously deriving them purely through postulates.

After googling it, I found a link to it here:

http://www.jimloy.com/geometry/obtuse.htm

Getting back to calculators, I think the important thing to take from this is that calculators aren't substitutes for your brain. They really should just be used as time saving devices for problems you do understand, not as a "black box" to give you a solution that you couldn't get on your own. While the first example was for a symbolic calculation, there are tricky things that come up with purely numerical calculations. I had a book once that listed a bunch of problems that any calculator would eventually give a wrong answer for (of course, these calculations had to be long for the errors to build up). I can't remember them off the top of my head, but I do remember a different common example: Solving Schrodinger's Equation to find an energy eigenvalue. If the energy in the equation is correct, then solving the equation should give a function that decays to zero at infinite position. Instead, if you solve it numerically (with Euler's rule, or Runge Kutta, or anything else you can think of), the function will always eventually exponentially diverge to infinity (or negative infinity). The reason is that the general solution of the equation is a linear combination of exponentially growing and decaying terms; at the proper energy only the exponentially decaying term is present. But inevitable accuracy errors will introduce the growing term, which will eventually dominate. It's not a big deal, so long as you know what's going on.


#72

If you multiply both sides of the original equality you get a quadratic. If I haven't slipped up in solving the quadratic, X = +/-i*sqrt(15)

3x + 1/(x-5) = 15 - 1/(x-5)

3x(x-5) + 1 = 15(x-5) -1

3x(x-5) - 15(x-5) = 0

3x^2 - 15x -15x + 75 = 0

x^2 + 15 = 0

x = +/-sqrt(-60)/2

x = +/- i*sqrt(15)

Beware of explanations of fallacies. It's been my experience that a many of the explanations for fallacies contain fallacies themselves.


#73

You made a mistake. A couple, actually.

Quote:
3x + 1/(x-5) = 15 - 1/(x-5)

It should have been plus on both sides of the equation; however, you later cancelled those terms as though it was written correctly, so that had no effect. The bigger mistake is here.

Quote:
3x^2 - 15x -15x + 75 = 0

x^2 + 15 = 0



You cancelled the -15x - 15x terms, but they actually combine to form -30x.

Then dividing by 3 gives

x^2 - 10x + 25 = 0

(75/3 = 25, not 15)

This has the double root x = 5.

#74

(-1)^2 = 1

Taking squareroots cancels the square on the left, leaving

-1 = 1.

As I remember:

sqrt(X^2) = abs(X), not X, isn't it?

Best regards!
Artur


#75

Yes and no. That's the customary definition, but

a) It could just as easily be defined as -abs(x). That still restricts the squareroot to one branch, and would avoid the problem in the "proof".

b) It only works for real numbers. For imaginary numbers,

sqrt(z) = sqrt(abs(z))(cos(arg/2) + i sin(arg/2))

with arg limited to being between any two real numbers whose difference is 2 pi radians. (eg, it could be between -pi and pi, or 0 and 2 pi. The actual choice is arbitrary). With that restriction, you will be on only one branch of the squareroot function. If you let arg be *any* number, you can cross branches and get an error similar to the one in the "proof" (eg, let arg for -1 be 3 pi, and arg for +1 be 0).


Here's a slightly trickier version of the same "proof":

(-1)^2 = 1^2, evaluates to 1 = 1, so is obviously true.

Take logs of both sides:

log((-1)^2) = log(1^2)

Properity of logs

2*log(-1) = 2* log(1)

Divide by 2

log(-1) = log(1)

Exponentiate

-1 = 1.

#76

"sqrt(X^2) = abs(X), not X, isn't it?"

NOPE!

In the real world, you sometimes need to consider both the positive and negative square roots.

For example, in kinematics (the motion of bodies in physics), the relation between the acceleration of an object "a" (assumed to be constant during the problem), the displacement "x", and the initial and final velocities ("v0" and "v") is

v^2 = v0^2 + 2ax .

Consider that you are given the initial velocity, a negative acceleration, and displacement of a vehicle and then are asked to find the final velocity. There are TWO possible answers - the result of taking the + or - square root, where the sign of the answer indicates whether you are going forward or backwards at the end. The + answer corresponds to the vehicle still going forward (assuming the v0 was positive and x is positive) at position (displacement - we usually assume that you start at position x=0) x. The negative answer corresponds to the vehicle having overshot position x but continuing to slow down and finally reversing (as it continues to accelerate in the negative sense) and coming back to position x, now travelling in the negative (backwards) direction.


#77

Dave Shaffer stated,

Quote:
"sqrt(X^2) = abs(X), not X, isn't it?"

NOPE!

In the real world, you sometimes need to consider both the positive and negative square roots.


If the absolute value were not taken, square root would not be a function in the strict mathematical sense. This is because a "function" has only one output value.

By convention, the positive value is defined as the output, even though the negative value is equally valid from a mathematical standpoint, and is often relevant.

Consider the well-known quadratic equation:

     a*x^2 + b*x + c = 0 
==>
x(1) = [-b + sqrt(b^2 - 4*a*c)] / (2*a)

x(2) = [-b - sqrt(b^2 - 4*a*c)] / (2*a)

Only the positive square root is used, but it is subtracted in one case to effect the "negative" square root.

-- KS


Edited: 8 Sept 2005, 12:59 a.m.


#78

Hi all.

The square root "function' is not really a "function"...

A root of an equation is just that: a ROOT.

The square roots of 4 are 2 AND -2.

In general terms a square root of a (real natural) number is
only one of two roots.

A cube root of a (RN) number is only one of three roots.

Take 8 for example:

The cube root we all know is 2...

But there are two other complex roots of 8...

Sorry Karl, but I'm with Dave on this one (fwiw)...

DW


#79

Hello, Don --

Quote:
The square root "function' is not really a "function"...
A root of an equation is just that: a ROOT.

So, f(x) = e0.5*ln(x) isn't really a function? It gives the positive square root of every real x > 0...

Of course, x represents a number in this context, not a symbolic expression.

Quote:
The square roots of 4 are 2 AND -2. In general terms a square root of a (real natural) number is only one of two roots.

A cube root of a (RN) number is only one of three roots.
Take 8 for example: The cube root we all know is 2...
But there are two other complex roots of 8...


Sure, that's all undisputed. (Primary) roots can be found for complex-valued numbers as well, using built-in functions on some calculators. Try it on the 15C, 42S, or RPL models!

The Fundamental Theorem of Algrebra, if I recall, is that a polynomial of order N has N roots.

Quote:
Sorry Karl, but I'm with Dave on this one (fwiw)...

I never said that Dave was wrong, only that, by convention, the positive-valued square root is the one returned.

-- KS

#80

Quote:
Now, by definition, we have the identity:
     x^3 = x^2 * x = x^2 + x^2 + x^2 + ... + x^2 
<---(x summands in all) -->

I wonder how this "definition" can be applied to x=sqrt(2) for instance:

     sqrt(2)^3 = 2 * sqrt(2) = 2 + 2 + 2 +    ...        + 2 
<-(sqrt(2) summands in all)->
:-)

J-F

Edited: 9 Sept 2005, 8:07 a.m.


Possibly Related Threads...
Thread Author Replies Views Last Post
  Need help understanding math.... cyrille de Brébisson 9 445 12-13-2013, 02:23 AM
Last Post: Didier Lachieze
  HP Prime - most favorite command bluesun08 2 236 11-12-2013, 11:29 AM
Last Post: bluesun08
  HP Prime: run a program in another program Davi Ribeiro de Oliveira 6 328 11-11-2013, 08:28 PM
Last Post: Davi Ribeiro de Oliveira
  OT: a math competition site Pier Aiello 0 131 09-16-2013, 06:03 AM
Last Post: Pier Aiello
  Simple Math Question Namir 2 172 08-09-2013, 06:13 PM
Last Post: Eddie W. Shore
  HP-41 New versions of your favorite modules - with an AOS twist :-) Ángel Martin 13 513 06-21-2013, 01:29 PM
Last Post: Diego Diaz
  Cool math clock Bruce Bergman 28 1,099 04-10-2013, 03:13 AM
Last Post: Siegfried (Austria)
  Math Challenge I could not solve Meindert Kuipers 22 861 01-05-2013, 04:43 PM
Last Post: Thomas Klemm
  Math Question Namir 0 108 11-06-2012, 07:43 AM
Last Post: Namir
  Survey for Special Math Problem Namir 7 341 06-03-2012, 09:46 PM
Last Post: Namir

Forum Jump: