Ask Professor Puzzler
Do you have a question you would like to ask Professor Puzzler? Click here to ask your question!
Annabelle from England asks, "A farmer had 30 cows and 28 chickens.how many are left?"
Well, Annabelle, I think you may be conflating two different riddles that are somewhat similar, because I've never heard that riddle stated like that.
Here are the two riddles I have heard, which are similar:
Riddle One: A farmer has 26 sheep and 2 died. How many are left?
Riddle Two: A farmer has 30 cows and 28 chickens. How many didn't?
The problem is that neither of these riddles are fair if you put them in writing, because they rely on similarities of spoken words to trick the listener. Once you commit it to writing, it's no longer a fair question.
You see, in riddle number one, if I was asking it out loud, what I would really be saying is: "A farmer had twenty sick sheep, and two died." So clearly the answer is 18, instead of the 24 you were expecting.
In the second riddle (which sounds like it makes no logical sense), the question (when spoken) is actually "A farmer has 30 cows, and 20 ate chickens." So if there were 30, and 20 of them ate chickens, 10 didn't.
So there you go. A couple riddles that aren't fair to commit to writing, but are fun if you speak them aloud!
And while we're on riddles, here's a riddle I told some people at my school, and then told them, "In five minutes you won't be able to tell this riddle to anyone."
The riddle is: "Do you know how long cows should be milked?"
And the answer is: "The same as short ones."
Five minutes later I asked them to repeat the riddle back to me, and I got things like:
"How long should you milk a cow?"
"How do you milk a long cow?"
"How are long cows milked?"
It's a fun riddle, because if you don't word it exactly the way I did originally, it spoils the joke!
Kelly from the United States, has some questions that relate to our "Secret Messages and Codes" reference pages, about how different types of "things" get converted into hexadecimal and/or binary. This post will be an attempt to explore encoding a bit more.
Encoding Colors
In your computer's web browser, every color is made up of three numbers. Those three numbers are the red component of the color, the green component, and the blue component. Each of those numbers can range from 0 to 255, with 0 meaning, "Don't use this color," and 255 meaning "Give it all you've got of this color!" and all the numbers in between representating different gradations of that color.
So, for example, you could have a color represented like this: rgb(0,255,0), and that color would be green. You could represent another color like this: rgb(255,0,255). That color would be purple (full-blast red and blue, without any green). Or rgb(128,128,128). That color is equal amounts of all three components, which gives you gray.
rgb(255,255,255) is white, and rgb(0,0,0) is black.
However, that's not the only way to write colors for the computer to understand - you can take those three color components and write them in hexadecimal to tell the computer what the color is.
For example, if a website designer wanted to tell the browser to paint the screen dark purple, the designer could give the browser this number:
#440044
To see how this is purple, split it up into three 2-digit hexadecimal numbers:
#44, #00, #44
Since #44 = 68 (because #44 = 4 times sixteen, plus 4 more), and #00 = 0, this is identical to rgb(68,0,68).
Encoding Numbers
Encoding numbers - either into binary or hexadecimal - is done by the process outlined on our reference pages. It's a structured mathematical process by which we determine the largest power of the base (two or sixteen, for binary or hexadecimal respectively) and then work backwards to determine the digits of the number in a new base.
If I'm programming a computer, and I want the computer to multiply something by 51, my program includes the number 51, but the computer converts that to 110011binary before storing it, because the computer does all its calculations in binary, and all its memory storage is binary.
Encoding Graphemes
Do you know what a grapheme is? It is defined as follows: "A grapheme is the smallest unit used in describing the writing system of any given language." Graphemes are the symbols we use to represent meaning.
Graphemes include letters, numbers, and all our punctuation marks - basically, all the characters on your keyboard. Graphemes, like numbers, need to be converted into a numerical language the computer can understand if we want them to be stored in the computer. Technically, they are stored in binary, but we often use hexadecimal to represent graphemes.
But how in the world do you convert something like "&" to a number? There isn't a mathematical process you can use to do that, is there? No, there isn't. There's also no mathematical process for converting the letter "A" to hexadecimal. And, to make your head spin a little, there's also no mathematical process for converting "1" into hexadecimal.
Notice that I put the number "1" in quotes. Because it's not the number 1, it's the grapheme for the number 1.
So if there's no good mathematical method for doing this conversion, what do we do? We just create a table of values, and arbitrarily assign a number to each grapheme. For example,
"A" = 41
"B" = 42
"C" = 43
SPACE = 20
"1" = 31
"2" = 32
"&" = 26
Note that all of these are hexadecimal values. It may be strange to wrap your brain around the fact that "1" = 31. Mind you, I'm not saying 1 = 31. I'm saying "the grapheme for the number 1 has a value of 31 (hex)." If I tried to tell the computer that one equals 31, I think it would have a meltdown!
Incidentally, in computer programming, we don't call them "graphemes" - we call them "characters." And we don't limit ourselves to visible symbols; we also have character codes for things like the backspace key and the tab key, and the arrow keys.
Syntax Determines Encoding
Here's where we finally get around to answering Kelly's questions, which are along the lines of "If I enter 'PURPLE' in the hexadecimal encoder, why doesn't it give me the color values you describe? And If I enter the number 52 in the binary encoder, why doesn't it give me the value you say it will?"
And the answer is: Our encoder is an encoder for graphemes, rather than an encoder for colors and numbers.
So when you entered "PURPLE," you thought you were saying to the computer, "Show me the hexadecimal value for the color purple," but really you were saying, "Show me the hexadecimal values for the graphemes 'P', 'U', 'R', 'P', 'L', and 'E'."
Similarly, when you entered "52," you thought you were saying to the computer, 'Show me the binary value of the number 52, but really, you were saying, "Show me the binary values for the graphemes '5' and '2'."
The key is, we tell you "enter some text" - whenever we are entering "text," we are entering graphemes for the computer to deal with.
In computer programming, and in web design, we have to be able to specify how we want to have the computer interpret the content we provide - whether we want the computer to interpret as colors, as numbers, or as text. This is why programming languages have syntax, or programming "grammar" - the grammar of a programming language helps the computer determine how we want to have things understood.
It's just like English grammar, in a way. Consider the word "content" used in the paragraph above. "Content" can be either a noun or an adjective ("I added content to the page," vs. "I am content with this page."). But when you read the sentence above, you probably didn't even hesitate to understand how I intended you to interpret the word "content." Why? Because the structure/grammar/syntax of the sentence made it clear how the word was to be interpreted.
In the same way, in the world of computer programming and web design, we use syntax to indicate how we want information to be interpreted. One of the simplest rules is: If we put it in quotes, we want it interpreted as graphemes. Of course, nothing can be that simple. A quotation mark is a grapheme, so what if you want a quotation mark inside the text? How does the computer know whether to interpret that quotation mark as the end of the text, or as part of the text? The rules can get messy!
So for our encoder, since we've said, "enter some text," your entire entry in the textbox is treated as content to be interpreted as graphemes.
I hope that lengthy explanation added some clarity for you! Thanks for asking.
Here's another blog post that explores encoding some more: Letter codes and binary.
If you got to this page by way of Facebook, or other social media, you probably got here by clicking on an image that looks like this:
This is an image I pulled off Facebook, and tweaked the text at the bottom. The person in the image is television host and political commentator Rachel Maddow. The original text (before I modified it) read: "Trump supporters, protestors clash in Chicago/Violence erupts inside postponed rally."
So let me explain what's going on here. Facebook allows web desigers to make use of something called "open graph" icons to give people a hint of what the post is about. If you assign an open graph icon to your blog post, when someone shares it on facebook, that image is what appears in their facebook feed, above the page's title and description.
But dishonest websites like to "trick" people into clicking their links. They think, "Oh, my article isn't interesting enough that people will want to visit my page. But if they think it's a video, they'll click it, because they think it'll play right in their Facebook page without loading an entirely new page. So I'll take a still shot from a video, make sure it has the little red play icon in the middle, and it will be completely indistinguishable from a video!" (There's even a WordPress plug-in that'll help you create that "here's a video" deception.)
An icon is "a person or thing regarded as a representative symbol of something." Icons have meanings. The little red rounded rectangle with a triangle in it has a specific meaning. It means "This is a video. Click to start watching." It does not mean, "Hey, my website has a video, and if you click here, I'll show you about 500 ads, and then, if you can manage to locate it, you can click another arrow icon that means what you expected this one to mean."
Why didn't they just post the video? Because if they post the video, people might not click through to their website, and if people don't click through to their website, they won't get ad impressions on their site, and they won't get revenue.
And the "pretend video" image isn't the only kind of click-bait out there, of course. You have articles with titles like, "You won't believe what happened next..." and "This will completely destroy Obama's presidency..." and "This video had me crying at 1:24..." and you can't resist the urge to click, even though you know it's not going to make you cry, it's not going to end anyone's presidency (or candidacy) and when you've finished reading/watching, you're going to wish you hadn't wasted your time.
But you just can't resist clicking...
To make matters worse, many click-bait sites masquerade as right-wing "news" sites or left-wing "news" sites. I say "masquerade" because most of them have no inclination to do any fact checking. They expect you to do their fact checking for them. Actually, scratch that. They don't expect any such thing. They assume that you'll see their page, recognize that they hold to the same core left/right values as they do, and therefore assume that anything they say must be true.
The only thing that's more insane than the stuff that gets reported on these "news" sites is the masses of people who - apparently without thought - like and share it.
Don't be gullible. You're a smart person. You know how to think for yourself, and do a little research.
My general policy is, when I see click-bait titles or "fake video" images, I don't click them, because I don't want to help click-bait sites get any income. The more we encourage them, the more they proliferate. But in this case, since I've been wanting to write this blog post, I bit the bullet and clicked through.
The page I got to when I clicked the "breaking news" image was so filled with advertising that when I found the actual video on the page, the video would not stop scrolling out of view over and over again for about 20 seconds, while advertising filled in all around it. I'm not exaggerating.
There was a brief associated article, which said absolutely nothing that added anything to the video. That in itself ought to cause you to ask: "Why does the page even exist?"
The answer is: the page exists to earn money. And that's not necessarily a bad thing. But, if a page exists only to earn money, adds no value to content that exists elsewhere, places no value on positive user experience, or places no value on truth, then it's a page that probably shouldn't exist.
The problem is, once people have been sucked into the vortex of a click-bait site, if they like the video (or other content) they saw there, they feel as though their best option is to share it from the depths of the cesspool.
But here's the thing. You're not stuck sharing their version. Because you're a smart individual, and you value your friends far too much to make them suffer through the same foolishness that you just suffered through. You're intelligent enough - all you have to do is run a search engine query to find a better version of the content somewhere else. In fact, you already did that when you fact-checked the content! (Right?) In the case of my example, I just searched for "Rachel Maddow Trump protest" in google, and found the original video.
Share original content, not desperate click-bait copycats. All your friends will thank you.
And then, just to complete your helpfulness, go back to facebook, find the click-bait link you clicked on, and report it to Facebook, telling them that it's spam, or that it's unhelpful content, or whichever reporting option you find most appropriate. Facebook actually has stated on their blog that they want to eliminate click-bait, and are steering their algorithms in that direction. Give them a helping hand.
Please do your part to resist click-bait. Because you're smarter than that.
Dave, an 8th grader, asks:
Let's say you are making a list. Would you, or would you not put a comma before the “and”?
Good question. What Dave is referring to here is the Oxford comma, sometimes also called the “serial comma.” We know that we should put a comma between each item in a list to avoid confusion, but there is some debate over whether there should be a comma after the second-to-last item.
For example:
“Today we went to the store and bought milk, bread, eggs, and apples.”
The comma after the word “eggs” is an example of the Oxford comma. Some say that this is unnecessary, because the word “and” indicates the almost-end of the list and serves the same function as a comma.
Those opposed to the Oxford comma would write that sentence this way:
“Today we went to the store and bought milk, bread, eggs and apples.”
Now, the addition of an Oxford comma may not seem like a big deal in a short sentence like this. But the longer the sentence gets, the more useful it can be. And I don’t mean “longer” in the sense of more items in the list, but more complex “items,” such as phrases rather than single words.
For example:
“When interviewing potential new employees, Richard was careful to pay attention to each candidate’s sense of confidence in their abilities, attitude toward their previous education and employment and their ability to express themselves in a succinct manner.”
That’s a pretty long sentence, and each item is much longer than in our previous sentences. Do you see how the section “education and employment and their ability” could be confusing upon first reading? Without the Oxford comma here, that last segment is a lot longer and starts to feel like a run-on sentence.
Let’s look at this sentence again with the Oxford comma:
“When interviewing potential new employees, Richard was careful to pay attention to each candidate’s sense of confidence in their abilities, attitude toward their previous education and employment, and their ability to express themselves in a succinct manner.”
By using the Oxford comma, we help to avoid confusion about whether the word “and” is being used as a part of one of the list items, or indicating the last item of the list.
Those who recommend the use of the Oxford comma will also use sentences similar to the following one, as an example for why we need that extra comma:
“I’m grateful to my sisters, Jan and Devon.”
What is the speaker saying here? Are they grateful for their two sisters who are named Jan and Devon, or are they grateful to their sisters and two other people named Jan and Devon? In other words, does the comma introduce the first item in a list, or does it introduce an elaboration upon that first item?
So that's an explanation of the Oxford comma.
But that’s not what this question is asking. The question is asking whether the Oxford comma should be used in general.
Well, first I’ll tell you what a couple style guides recommend.
The Chicago Manual of Style says the following:
“When a conjunction joins the last two elements in a series of three or more, a comma—known as the serial or series comma or the Oxford comma—should appear before the conjunction. Chicago strongly recommends this widely practiced usage … since it prevents ambiguity.” (6.18)
The AP Stylebook, on the other hand, says to omit the Oxford comma in a simple series, but recommends it for a longer, more complex series (like the second pair of sentence examples above).
Personally, I use the Oxford comma even in a simple series, following Chicago’s recommendation. For one thing, consistency is important, and rather than trying to determine how “complex” a complex sentence must be before it merits a serial comma, I think it’s best to use it in every series. When we are able to expect the Oxford comma to be used, we don’t have to wonder while reading whether an “and” is a conclusion of a series or part of a series element. (For example, “For breakfast we had eggs, bacon, toast and jam.” One might expect “toast and jam” to be a combined element, and so without the Oxford comma, you have to finish the sentence before you figure out what the “and” is doing.)
The role of punctuation is to make our words easy to understand, and having the consistent structure of an Oxford comma in place aids in understanding. The more consistent we can be with punctuation, the more attention we can focus on the words themselves, and the more quickly and easily we’ll be able to read and understand another’s writing.
Hi Professor, I saw this riddle on a website: "The sum of three numbers is equal to their product. What are the numbers?" They gave an answer of "1,2, and 3". I wondered if this is the only answer. verity
Hi Verity,
In order to answer this question, we should start by writing the problem algebraically:
abc = a + b + c
What you should notice right away is that there are three unknowns (three variables) and only one equation. This makes it seem very likely that there will be multiple solutions. The first thing I tried with this equation was to solve for one variable. Shall we solve for a? Here are my steps:
abc = a + b + c
abc - a = b + c (subtract a from both sides)
a(bc - 1) = b + c (factor out an a)
a = (b + c)/(bc - 1) (divide both sides by bc - 1)
You know what this looks like to me? It looks like we can pick any values we want for b and c, as long as b and c aren't reciprocals of each other, and we'll get a value for a. b and c can't be reciprocals of each other because then (bc - 1) would be zero, and we'd have a division by zero, which is illegal, immoral and socially unacceptable.
So let's pick a couple values. b = 3; c = 4.
a = (3 + 4)/(12 -1 ) = 7/11.
Let's test our answer:
3 + 4 + 7/11 = 84/11.
3(4)(7/11) = 84/11.
Sure enough, they're the same! So the answer to your question is, no, their solution is not the only one; there are an infinite number of solutions.
I suspect that the site intended to make it more challenging by requiring you to use only integers, or maybe distinct integers. But that doesn't change the fact that there's an infinite number of solutions. For any integer x, the following three numbers work:
x, 0, -x