Or And Confusion

P

peetm

Why do so many people get Or and And mixed up - is it something to do with
English usage?
 
A

Alan Balmer

Why do so many people get Or and And mixed up - is it something to do with
English usage?
Since Or and And are English words, it must have something to do with
English usage, if true ;-)

Did you mean '|' and '&', or '||' and '&&'?
 
S

Simon Biber

peetm said:
Why do so many people get Or and And mixed up - is it something to do with
English usage?

English usage of "or" and "and" are quite different to mathematical
usage of the terms.

Q: "Would you like an orange or an apple?"

To most people, this is a choice between the given options. There are
four possible answers: "an orange", "an apple", "both", or "neither".

To a mathematician, this is a yes/no question. If the mathematician
would like either an orange or an apple or both, they will answer "yes".
If they don't want either an orange or an apple, they will answer "no".

Consider the following answers to a simple question:
Q: Who can go to the beach?

A1: Charles and Michelle
A2: Charles and not Michelle
A3: Charles or Michelle
A4: Not Charles or Michelle.
A5: Not Charles and Michelle.
A6: Not Charles but Michelle.

Of the five answers given above, answers 1 and 2 translate directly into
boolean logic:
A1: Charles && Michelle
A2: Charles && !Michelle

Answer 3 is somewhat ambiguous, but usually means one of the two but not
both, ie. an exclusive or.
A3: Charles ^ Michelle

Answers 4 and 5 in English actually have the same meaning as each other,
due to De Morgan's law. Answer 4 means "not (charles or michelle)",
while answer 5 means "not charles and [not] michelle". One of the
properties of the word "and" in English is that qualifiers such as "not"
on the left hand side automatically apply to the right hand side as well.

A4: !(Charles || Michelle)
A5: !Charles && !Michelle

Answer 5 introduces an extra word, "but", which does not exist in
Boolean logic, but must be used in English in some cases. The word "but"
alerts the reader that a condition that existed before has now changed.
It allows one to express !Charles && Michelle in English, without the
problem that "and" causes the "not" to also apply to the right side.

A6: !Charles && Michelle

The word "but" should perhaps also be used in answer 2: "Charles but not
Michelle", however it does not change the meaning of the sentence if
replaced by "and" in this case.
 
S

Simon Biber

peetm said:
Why do so many people get Or and And mixed up - is it something to do with
English usage?

English usage of "or" and "and" are quite different to mathematical
usage of the terms.

Q: "Would you like an orange or an apple?"

To most people, this is a choice between the given options. There are
four possible answers: "an orange", "an apple", "both", or "neither".

To a mathematician, this is a yes/no question. If the mathematician
would like either an orange or an apple or both, they will answer "yes".
If they don't want either an orange or an apple, they will answer "no".

Consider the following answers to a simple question:
Q: Who can go to the beach?

A1: Charles and Michelle
A2: Charles and not Michelle
A3: Charles or Michelle
A4: Not Charles or Michelle.
A5: Not Charles and Michelle.
A6: Not Charles but Michelle.

Of the six answers given above, answers 1 and 2 translate directly into
boolean logic:
A1: Charles && Michelle
A2: Charles && !Michelle

Answer 3 is somewhat ambiguous, but usually means one of the two but not
both, ie. an exclusive or.
A3: Charles ^ Michelle

Answers 4 and 5 in English actually have the same meaning as each other,
due to De Morgan's law. Answer 4 means "not (charles or michelle)",
while answer 5 means "not charles and [not] michelle". One of the
properties of the word "and" in English is that qualifiers such as "not"
on the left hand side automatically apply to the right hand side as well.

A4: !(Charles || Michelle)
A5: !Charles && !Michelle

Answer 6 introduces an extra word, "but", which does not exist in
Boolean logic, but must be used in English in some cases. The word "but"
alerts the reader that a condition that existed before has now changed.
It allows one to express !Charles && Michelle in English, without the
problem that "and" causes the "not" to also apply to the right side.

A6: !Charles && Michelle

The word "but" should perhaps also be used in answer 2: "Charles but not
Michelle", however it does not change the meaning of the sentence if
replaced by "and" in this case.
 
A

Alexei A. Frounze

peetm said:
Why do so many people get Or and And mixed up - is it something to do with
English usage?

It has something to do with thinking, wrong thinking. If that's not the
case, then it has to do with memorizing. Otherwise, there should be no
reason to mix up two semantically different things.

Alex
 
K

Kenneth Brody

peetm said:
Why do so many people get Or and And mixed up - is it something to do with
English usage?

"And" and "or" to computers are more precise than they are when used in
general English conversation.

Consider:

Give me a list of people who live in New York and New Jersey.

If asked of a human, they are likely to give you a list of those people
who live in New York and those who live in New Jersey, eliminating the
duplicates. (ie: they live in New York, _or_ they live in New Jersey.)

If asked of a computer, you are likely to be given a list of people who
have at least two residences, one in New York and another in New Jersey.
(ie: they live in both New York _and_ New Jersey, exactly as asked.)

To a computer, the question should be "give me a list of people who live
in New York _or_ New Jersey".

--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody/at\spamcop.net | www.fptech.com | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
Don't e-mail me at: <mailto:[email protected]>
 
K

Keith Thompson

Kenneth Brody said:
"And" and "or" to computers are more precise than they are when used in
general English conversation.

Consider:

Give me a list of people who live in New York and New Jersey.

If asked of a human, they are likely to give you a list of those people
who live in New York and those who live in New Jersey, eliminating the
duplicates. (ie: they live in New York, _or_ they live in New Jersey.)

If asked of a computer, you are likely to be given a list of people who
have at least two residences, one in New York and another in New Jersey.
(ie: they live in both New York _and_ New Jersey, exactly as asked.)

To a computer, the question should be "give me a list of people who live
in New York _or_ New Jersey".

In my opinion, that should be the question when asking either a
computer or a person. Maybe it's because I'm a math/computer geek,
but if someone asked me for "a list of people who live in New York and
New Jersey", I'd probably assume he wanted a list of people with two
residences -- or I'd ask for clarification.

(Then again, if you ask me "Do you want soup or salad?", I'm likely to
say "Yes". This has not, so far, led to violence.)
 
R

Richard Heathfield

Keith Thompson said:
(Then again, if you ask me "Do you want soup or salad?", I'm likely to
say "Yes". This has not, so far, led to violence.)

If asked "tea or coffee?" I answer "coffee", despite the great temptation to
say "yes". I don't want there to be any possibility of people thinking I'll
consider tea to be acceptable. In the real world, pragmatism sometimes
trumps pedantry.
 
K

Keith Thompson

Richard Heathfield said:
Keith Thompson said:

If asked "tea or coffee?" I answer "coffee", despite the great temptation to
say "yes". I don't want there to be any possibility of people thinking I'll
consider tea to be acceptable. In the real world, pragmatism sometimes
trumps pedantry.

<OT>
If you were a Lisp hacker, would you be able to resist the temptation
to answer "t"?
</OT>
 
J

Joe Wright

Richard said:
Keith Thompson said:




If asked "tea or coffee?" I answer "coffee", despite the great temptation to
say "yes". I don't want there to be any possibility of people thinking I'll
consider tea to be acceptable. In the real world, pragmatism sometimes
trumps pedantry.

There are two separate questions here. "Do you want soup or salad?" begs
the answer "Yes" if one or the other, "No" if neither. "Which of soup or
salad do you want?" is a different question which begs "Soup, please.",
"Salad, please.", or "Neither, thank you."

I don't get the pragmatism over pedantry point. They are two different
questions, in a restaurant or in a program.
 
K

Keith Thompson

Joe Wright said:
There are two separate questions here. "Do you want soup or salad?"
begs the answer "Yes" if one or the other, "No" if neither. "Which of
soup or salad do you want?" is a different question which begs "Soup,
please.", "Salad, please.", or "Neither, thank you."

I don't get the pragmatism over pedantry point. They are two different
questions, in a restaurant or in a program.

Pragmatically, if a waiter asks you "Do you want soup or salad?", he
almost certainly means "Which of soup or salad do you want?".

This does leave the waiter without a good way to ask "Do you want one
of soup or salad?" without asking which, but that's not a question a
waiter is likely to need to ask. Knowing that you want either soup or
salad doesn't do him much good unless he knows which one. Most people
will take advantage of that context to infer what the waiter really
meant, even if it's not literally what he said.

We don't expect compilers to be so aware of context that they can
distinguish whether (x or y?) is a yes/no question or an x/y question
depending on what x and y happen to be, and who happens to be asking
the question. For the most part, we don't *want* them to be that
smart; if they were, it would enable a whole new class of mistakes
that compilers aren't yet smart enought to make. We can make those
mistakes without help, thank you very much.
 
R

Richard Heathfield

Joe Wright said:
There are two separate questions here. "Do you want soup or salad?" begs
the answer "Yes" if one or the other, "No" if neither.

Yes, but if you dearly love soup and cannot stand salad at any cost,
answering "yes" runs the risk of landing you with salad. Waitresses are not
required by ISO to be very fond either of Boolean logic or smart-alec
programmers.
I don't get the pragmatism over pedantry point. They are two different
questions, in a restaurant or in a program.

Indeed. And that's why, in a restaurant, you should be careful not to treat
the waitress as if she were a CPU.
 
D

Dik T. Winter

> Pragmatically, if a waiter asks you "Do you want soup or salad?", he
> almost certainly means "Which of soup or salad do you want?".

I do not think so. At least that is not my experience. The only case
is where the menu you have chosen gives you the choice between soup and
salad.
> This does leave the waiter without a good way to ask "Do you want one
> of soup or salad?" without asking which, but that's not a question a
> waiter is likely to need to ask.

If the menu you have chosen does not contain either, that is a likely question
to ask, which may also be asked in the first version.

To get more European. Many European menus include a dessert that is either
coffee, or ice-cream or somesuch. So if the menu included such, when the
waiter asks if I want coffee or ice-cream he clearly implies that I may
chose one (and sometimes I say both and get both, and sometimes I say
neither and get none). When the menu does not include such a dessert
the question clearly indicates that the waiter is asking whether I want
more. And still my reply can be either one, both or neither.
 
K

Keith Thompson

Dik T. Winter said:
I do not think so. At least that is not my experience. The only case
is where the menu you have chosen gives you the choice between soup and
salad.

Perhaps its a regional thing. Anyway, this passed the outer
boundaries of topicality some time ago.
 
K

Keith Thompson

Keith Thompson said:
Perhaps its a regional thing. Anyway, this passed the outer
boundaries of topicality some time ago.

I meant "it's", not "its". **argh**
 
A

Alan Balmer

There are two separate questions here. "Do you want soup or salad?" begs
the answer "Yes" if one or the other, "No" if neither. "Which of soup or
salad do you want?" is a different question which begs "Soup, please.",
"Salad, please.", or "Neither, thank you."

I don't get the pragmatism over pedantry point. They are two different
questions, in a restaurant or in a program.

The restaurant version, if I were writing it, would be more like "Do
you want soup? Or salad?"

In other words, the delivery disambiguates the question.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,169
Messages
2,570,919
Members
47,459
Latest member
Vida00R129

Latest Threads

Top