Group Abstract Group Abstract

Message Boards Message Boards

0
|
6.9K Views
|
12 Replies
|
3 Total Likes
View groups...
Share
Share this post:

What does the | symbol mean when used as solution by Reduce?

12 Replies
POSTED BY: Sander Huisman

It does look somewhat confusing, because the vertical bar |, which in this case means And, looks similar to the double bar ||, which means Or. Also, the name "Alternatives" usually means "either or", not And. However the documentation of Element states that the three following inputs are equivalent:

Element[x | y, Integers]
Element[x, Integers] && Element[y, Integers]
Element[{x, y}, Integers]

and they are different from

Element[x, Integers] || Element[y, Integers]

It is a design choice that probably has its rationale.

POSTED BY: Gianluca Gorni

This particular notation is also explained in the documentation for Element (third and fourth usage line) so it is not even necessary to search for the Alternatives symbol itself.

POSTED BY: Ilian Gachevski

Yeah, I said so too; quite unexpected output to be honest. But I see now that it is indeed returned by Reduce sometimes.

POSTED BY: Sander Huisman

Sander,

thank you for your help. However, Sam solved my problem showing me that the | symbol is actually Alternatives rather than VerticalSeparator. Now the solution makes sense to me.

Thank you again for your help.

Alessandro

Please indent your code using tab in front of each line such that it is displayed correctly.

What are eq2...eq6 ? I can't reproduce it without all code.

Try minimizing your problem.

POSTED BY: Sander Huisman

Hi Sam,

Thank you for your answer. I am sorry I am a newbie with Mathematica. However, I also looked in the doc for all the symbols Mathematica uses and I didn't find it. Next time I will look deeper.

Cheers,

Alessandro

POSTED BY: Sam Carrettie

Please submit the entire code (and/or entire input), I have a feeling there is an error in it. Normally you expect || in the output (Or). A single | is Alternatives in Wolfram Language but is only used for pattern matching as far as I know.

POSTED BY: Sander Huisman

Hi Ilian,

thank you for your reply. What I don't understand is why the symbol | (VerticalSeparator) has been used rather than something like one of the following?

{C[1], C[2], C[3]} [Element] Integers (as reported in the documentation for the Element operator)

{C[1] && C[2] && C[3]} [Element] Integers

Cheers,

Alessandro

It means that all the C[i] are integers. See also the documentation.

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