Difference between wolframalpha.com and tio.run/#mathematica

75 Views Asked by At

While solving the equation rx+(1-r)(1-x)=1/2 on wolframalpha.com returns x=1/2 as a solution, it returns error messages on tio.run/#mathematica:

Set::write: Tag Plus in rx + (1 - r) (1 - x) is Protected.
             1
Solve::naqs: - is not a quantified system of equations and inequalities.
             2

What is the reason for the different behavior on these two websites and what do these error messages mean ? What do the terms "Tag Plus", "Protected" and "quantified system of equations and inequalities" mean in this context ?
(Sorry for asking these novice questions - I don't have any knowledge of Wolfram Language or Mathematica.)

1

There are 1 best solutions below

0
On BEST ANSWER

WolframAlpha and Mathematica are two very different things. Mathematica is a programming language with a formally defined syntax. The correct format to solve an equation would be

lhs == rhs

Note the use of the double equals sign. For your equation, in particular, you might try:

Solve[(r*x + (1 - r)*(1 - x) == 1/2), x]

Here that is on Try it Online.

WolframAlpha, by contrast, is designed to accept "natural language input" and return computational results. You could solve your equation on WolframAlpha using the input

solve rx + (1 - r)(1 - x) = 1/2

which returns this output.

The specific complaints involving "Tag Plus", "Protected" and "quantified system of equations and inequalities" that Mathematica raises arise from the misuse of the single equals sign. If you try to set x^2=4 in Mathematica, for example, it will complain because you're effectively trying to redefine the Power function.