473,467 Members | 1,436 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Or And Confusion

Why do so many people get Or and And mixed up - is it something to do with
English usage?
Nov 15 '05 #1
17 1129
On Thu, 1 Sep 2005 15:46:02 +0100, "peetm" <us***********@gmail.com>
wrote:
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 '&&'?
--
Al Balmer
Balmer Consulting
re************************@att.net
Nov 15 '05 #2
;-)

Yup && and ||, i.e., esp. the logical operators

"Alan Balmer" <al******@att.net> wrote in message
news:g6********************************@4ax.com...
On Thu, 1 Sep 2005 15:46:02 +0100, "peetm" <us***********@gmail.com>
wrote:
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 '&&'?
--
Al Balmer
Balmer Consulting
re************************@att.net

Nov 15 '05 #3
peetm wrote:
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.

--
Simon.
Nov 15 '05 #4
peetm wrote:
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.

--
Simon.
Nov 15 '05 #5
"peetm" <us***********@gmail.com> wrote in message
news:df**********@news.ox.ac.uk...
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
Nov 15 '05 #6
peetm wrote:
Why do so many people get Or and And mixed up - is it something to do with
English usage?


Please, be more specific.

August

Nov 15 '05 #7
peetm wrote:

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:Th*************@gmail.com>
Nov 15 '05 #8
Kenneth Brody <ke******@spamcop.net> writes:
peetm wrote:

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".


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.)

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 15 '05 #9
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.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/2005
http://www.cpax.org.uk
email: rjh at above domain
Nov 15 '05 #10
Richard Heathfield <in*****@invalid.invalid> writes:
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.


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

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 15 '05 #11
Richard Heathfield wrote:
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.


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.

--
Joe Wright
"Everything should be made as simple as possible, but not simpler."
--- Albert Einstein ---
Nov 15 '05 #12
Joe Wright <jw*****@comcast.net> writes:
Richard Heathfield wrote:
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.


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.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 15 '05 #13
Joe Wright said:
Richard Heathfield wrote:
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.


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.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/2005
http://www.cpax.org.uk
email: rjh at above domain
Nov 15 '05 #14
In article <ln************@nuthaus.mib.org> Keith Thompson <ks***@mib.org> writes:
....
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.
--
dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~dik/
Nov 15 '05 #15
"Dik T. Winter" <Di********@cwi.nl> writes:
In article <ln************@nuthaus.mib.org> Keith Thompson
<ks***@mib.org> writes:
...
> 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.


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

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 15 '05 #16
Keith Thompson <ks***@mib.org> writes:
Perhaps its a regional thing. Anyway, this passed the outer
boundaries of topicality some time ago.


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

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 15 '05 #17
On Tue, 06 Sep 2005 20:17:16 -0400, Joe Wright <jw*****@comcast.net>
wrote:
Richard Heathfield wrote:
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.


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.
--
Al Balmer
Balmer Consulting
re************************@att.net
Nov 15 '05 #18

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Doug Farrell | last post by:
Hi all, I'm trying to do the following from within a code module: import re # text to match text = "Good morning x something /x, how are you today x something else /x"
1
by: Mathias Mamsch | last post by:
Hi, I have some confusion concerning the weakref module. I am trying to save a weak reference to a bound member function of a class instance for using it as a callback function. But I always...
38
by: Grant Edwards | last post by:
In an interview at http://acmqueue.com/modules.php?name=Content&pa=showpage&pid=273 Alan Kay said something I really liked, and I think it applies equally well to Python as well as the languages...
10
by: Kamilche | last post by:
I'm trying to pack two characters into a single byte, and the shifting in Python has me confused. Essentially, it should be possible to use a 'packed string' format in Python, where as long as...
4
by: JMCN | last post by:
object invalid or no longer set - confusion of the recordset in access 2003. i am currently converting from access 97 to access 2003. majority of the codes converted over perfectly fine, though...
0
by: i_have_control | last post by:
I'd be grateful for any input on this one: I have three web domains. The destinations of two are set to folders on the first, though that fact is transparent to the user (i.e: it does not...
13
by: Steve | last post by:
I have a form with a dataset and a datagrid. I created a dataview on this dataset. When the user modifies the datagrid, I look up this record in the dataview to make sure it is unique. Here is...
10
by: joelagnel | last post by:
hi friends, i've been having this confusion for about a year, i want to know the exact difference between text and binary files. using the fwrite function in c, i wrote 2 bytes of integers in...
1
by: Richard Lewis Haggard | last post by:
I'm having a problem with what appears to be some sort of confusion with references. I have a single solution with a dozen projects which has been working quite nicely for a while. The references...
2
by: Riaaaa | last post by:
Hello, We are doing the project in VB.Net. We had a great confusion for ASP.Net and VB.Net. Is VB.Net project performed in Microsoft Visual Studio 2005 ?? We have...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.