Group Abstract Group Abstract

Message Boards Message Boards

0
|
2.4K Views
|
6 Replies
|
8 Total Likes
View groups...
Share
Share this post:

Different outputs when using numerics vs variables

Posted 1 year ago
POSTED BY: Clifford Kelley
6 Replies
Posted 9 months ago

So, I thank everyone who replied. I've read more on this subject than i'd care to admit. I came across a blog by a Physicist who had also noticed the same thing. He asked Chatgpt why, and this is what Chatgpt said...

"4️⃣ Why numeric and symbolic differ

Numeric input: WA uses a calculator-style left-to-right evaluation: 6 ÷ 2 × 3 = 9

Symbolic input: WA uses algebraic conventions: a ÷ bc = a ÷ (b*c) = 1

So the difference comes from “numeric calculator rules vs algebraic coefficient rules.”

This seems to be what i was wanting to know. Thanks.

POSTED BY: Clifford Kelley

Natural Language mode uses the Wolfram|Aplha interpreter. That in turn uses a different precedence convention for the ÷ (obelus) than is used by the Wolfram Language (maybe also for the slash division sign, I'm not sure). All part of the the perils of trying to second-guess what the user intended.

POSTED BY: Daniel Lichtblau

Thank you. I appreciate what you're saying. Since my first post I've repeated the results by using "/" instead of "÷". The results are the same. It is giving a different result (and a different formulation) when using variables in place of numerals. I'll see what I can find on the Wolfram|Aplha interpreter, and read up on it to see if I can find my answer. Thank you for your time.

POSTED BY: Clifford Kelley
Posted 1 year ago

It would be helpful to know what result you actually got. Also, it would help us if you use the formatting tools to show exactly what you input.

I'm assuming that you didn't have a space between the b and c.

a = 6;
b = 2;
c = (1 + 2);

a/b c
(* 9 *)

a/bc (* notice no space *)
(* 6/bc *)
POSTED BY: Eric Rimbey

Thank you for your response. I apologize, I thought I had attached a picture to my first post with the results. You were correct in your assumption that no space was added between b and c. The only spaces I've used are after the commas between the variable definitions. I did both of these in Natural Language mode. To get the Obelus "÷" I used Alt+0247. I used an Obelus instead of the "/" as that's what the original numerical problem used. * I do understand that ÷ isn't really used anymore, but I was attempting to stay as accurate to the original as possible *

Thank you for taking the time to help me understand what I hope is just an error in my Input that I'm not grasping.

My results

POSTED BY: Clifford Kelley
Posted 1 year ago

Sometimes, if you experiment a little bit with inputs to Wolfram Alpha, you can find a syntax that Wolfram Alpha will show you an "Input interpretation" below your input that matches what you want.

Example: I found

a/b c where a=6, b=2, c=(1+2)

seems to be understood and interpreted by Wolfram Alpha to be what you want.

POSTED BY: Bill Nelson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard