# Easy math puzzle

**URL:** <https://boards.straightdope.com/t/easy-math-puzzle/836720>\
**Category:** Factual Questions\
**Created:** [July 8, 2019, 5:02pm UTC](https://boards.straightdope.com/t/easy-math-puzzle/836720 "2019-07-08T17:02:16Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![Dr.Strangelove](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dr.strangelove/32/6613_2.png) [@Dr.Strangelove](https://boards.straightdope.com/u/Dr.Strangelove)\
**Post date:** [July 8, 2019, 11:08pm UTC](https://boards.straightdope.com/t/easy-math-puzzle/836720/21 "2019-07-08T23:08:23Z")

</div>

> [@Sage\_Rat](#):
>
> Whereas, there is also the OR operation. ‘Or’ uses an “either” concept instead of a “both” concept:

A small additional note: we need to distinguish between the exclusive and inclusive OR. English tends to use the exclusive or–“Bob or Melinda wants ice cream” implies that one of them wants ice cream, but not both of them. In programming, the exclusive OR (XOR) is a separate operation, and the standard OR is inclusive. That is to say, it is true under all these conditions: Bob wants ice cream / Melinda wants ice cream / They both want ice cream.

Thinking about it a bit, it’s not possible for an inclusive OR to be grammatical without it being awkward. “Bob or Melinda wants ice cream” can only be correct if the OR produces a singular value. We would have to say “Bob or Melinda want(s) ice cream” to handle all cases if it were the inclusive OR.

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [July 8, 2019, 11:36pm UTC](https://boards.straightdope.com/t/easy-math-puzzle/836720/22 "2019-07-08T23:36:21Z")

</div>

In English, whether “or” is meant to be inclusive or inclusive depends on the context in a very complicated and difficult-to-unravel way. If I said “If Bob or Melinda wants ice cream, we should go get some”, then that’d be an inclusive or: Nobody would interpret that as meaning that if they both want it, I’m not getting any.

---

<div class="post-metadata">

**Author:** ![Dr.Strangelove](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dr.strangelove/32/6613_2.png) [@Dr.Strangelove](https://boards.straightdope.com/u/Dr.Strangelove)\
**Post date:** [July 8, 2019, 11:49pm UTC](https://boards.straightdope.com/t/easy-math-puzzle/836720/23 "2019-07-08T23:49:59Z")

</div>

> [@Chronos](#):
>
> In English, whether “or” is meant to be inclusive or inclusive depends on the context in a very complicated and difficult-to-unravel way. If I said “If Bob or Melinda wants ice cream, we should go get some”, then that’d be an inclusive or: Nobody would interpret that as meaning that if they both want it, I’m not getting any.

True enough (in my defense, I did say “tends to”). I wonder if any linguists have studied the subject. Is it one of those things, like adjective order, that everyone “knows” the rules for but hardly anyone can articulate? Does it vary between languages? Etc.

---

<div class="post-metadata">

**Author:** ![Smudge777](https://avatars.discourse-cdn.com/v4/letter/s/ee59a6/32.png) [@Smudge777](https://boards.straightdope.com/u/Smudge777)\
**Post date:** [July 9, 2019, 1:21am UTC](https://boards.straightdope.com/t/easy-math-puzzle/836720/24 "2019-07-09T01:21:10Z")

</div>

I think the only correct answer is “the solution depends upon the meaning of the symbols”.  
Mathematically, programmatically, linguistically, the same symbols can have multiple meanings. In this case, the question is vague enough that no one can sensibly argue that there is only one solution to the question “What is the value of x? x = 4 & 3”.  
There are multiple valid answers.

---

<div class="post-metadata">

**Author:** ![pulykamell](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/pulykamell/32/3166_2.png) [@pulykamell](https://boards.straightdope.com/u/pulykamell)\
**Post date:** [July 28, 2019, 10:39pm UTC](https://boards.straightdope.com/t/easy-math-puzzle/836720/25 "2019-07-28T22:39:33Z")

</div>

> [@Lance\_Turbo](#):
>
> Nailed it.

I actually had this show up in my feed today. It’s from Triplebyte, and the question is phrased as this:

> [@](#):
>
> What’s the value of x?
> 
> x = 4 & 3 // bitwise and

The “// bitwise and” part is in a darker grey so you don’t see it as well. I wonder if this is what the OP saw.

Actually, here’s a screenshot

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [July 29, 2019, 4:05am UTC](https://boards.straightdope.com/t/easy-math-puzzle/836720/26 "2019-07-29T04:05:01Z")

</div>

The color-coding there is of a sort that one might see in a text editor designed for programming, and the double-slash, in many programming languages, means that whatever follows it on that line is a comment (text added to a program which will be ignored by the computer, but which makes it easier for a human to read). That editor (whatever it is) apparently automatically color-codes numerical constants in purple, and comments in gray. And the programmer (whoever it was) anticipated that the meaning of & might be unclear to someone unfamiliar with that language (whatever it was), and so he put the comment in as a reminder of what it means.

Given all of that context, 0 is the clear and only correct answer.

---

<div class="post-metadata">

**Author:** ![Johnny\_L.A](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/johnny_l.a/32/1084_2.png) [@Johnny\_L.A](https://boards.straightdope.com/u/Johnny_L.A)\
**Post date:** [July 29, 2019, 1:51pm UTC](https://boards.straightdope.com/t/easy-math-puzzle/836720/27 "2019-07-29T13:51:44Z")

</div>

> [@pulykamell](#):
>
> The “// bitwise and” part is in a darker grey so you don’t see it as well. I wonder if this is what the OP saw.

Yes, that’s what I saw. I assumed it referred to a website or something.

[Previous page](https://boards.straightdope.com/t/easy-math-puzzle/836720.md?page=1)
