Welcome to The Riddler. Every week, I offer up problems related to the things we hold dear around here: math, logic and probability. Two puzzles are presented each week: the Riddler Express for those of you who want something bite-size and the Riddler Classic for those of you in the slow-puzzle movement. Submit a correct answer for either,1 and you may get a shoutout in the next column. Please wait until Monday to publicly share your answers! If you need a hint or have a favorite puzzle collecting dust in your attic, find me on Twitter.
As any caretaker can tell you, one challenging part of caring for an infant is interpreting their cry. Are they hungry? Are they tired? Do they need a diaper change?
Suppose you have an infant who naps peacefully for two hours at a time and then wakes up, crying, due to hunger. After eating quickly, the infant plays alone for another hour, and then cries due to tiredness. This cycle repeats several times over the course of a 12-hour day. (Your rock star baby sleeps peacefully 12 hours through the night.)
You’re working in an adjacent room when your partner walks out and hands you the baby monitor. You’ve completely lost track where in the day this happens. You continue working for another 30 minutes, then you hear the baby cry. What’s the probability that your baby is hungry?
The solution to this Riddler Express can be found in the following column.
This Sunday, March 14, is Pi Day! To celebrate, you are planning to bake a pie. You have a sheet of crust laid out in front of you. After baking, your pie crust will be a cylinder of uniform thickness (or rather, thinness) with delicious filling inside.
To maximize the volume of your pie, what fraction of your crust should you use to make the circular base (i.e., the bottom) of the pie?
Note: If you solve this riddle by baking an optimal pie, you automatically win.
The solution to this Riddler Classic can be found in the following column.
Solution to last week’s Riddler Express
Congratulations to ÑÑâÐVineet Rai ÑÑâÐ of Plano, Texas, winner of last week’s Riddler Express.
Last week, you had three coins in your pocket, each of which could have been a penny, nickel, dime or quarter with equal probability. You might have had three different coins, three of the same coin or two coins that were the same and one that was different.
Each coin bought you a string whose length in centimeters equaled the value of the coin in cents, i.e., the penny bought 1 cm of string, the nickel bought 5 cm of string, etc. After purchasing your three lengths of string, what was the probability that they could be the side lengths of a triangle?
Since each of the three coins could have been any one of a penny, nickel, dime or quarter, that meant there were 4×4×4, or 64, total cases to consider. Some of these 64 cases clearly resulted in triangles. For example, if you had three pennies in your pocket, then you could buy three strings that were each 1 cm long and form an equilateral triangle.
But suppose you had a penny, a nickel and a dime, meaning the three side lengths were 1 cm, 5 cm and 10 cm. There was simply no way to construct a triangle with these three side lengths! One way to see this was to look at the longest side, which was 10 cm. The other two sides (1 and 5 cm in length) had to somehow extend from one end of the longest side to the other. Their longest combined length was 6 cm, well short of the 10 cm requirement.
So when could three lengths be the sides of a triangle? When they satisfied the triangle inequality, which states that the sum of the length of any two sides must be greater than the length of the third. (If the sum of two sides equaled the third side, you got what is called a degenerate triangle, which was little more than a line segment and had zero area.)
Now that the geometry of the puzzle was settled, you were left with an exercise in counting and probability. There were four ways to make equilateral triangles: 1-1-1, 5-5-5, 10-10-10 and 25-25-25. There were also six distinct isosceles triangles you could make: 1-5-5, 1-10-10, 1-25-25, 5-10-10, 5-25-25 and 10-25-25. However, there were three ways to make each isosceles triangle, depending on which of the three coins (the first one in your pocket, the second coin or the third) was the smallest denomination. That meant there were four equilateral triangles plus 18 isosceles triangles, or 22 triangles in total. The probability of being able to make a triangle was therefore 22/64, or 11/32.
If you were one of those “degenerates” who counted the degenerate triangles (I’m regretting that poor attempt at wordplay already), then there was one more isosceles triangle to include: 5-5-10. Again, there were three ways to make it, which meant the overall probability increased to 25/64.
A few solvers double checked their work via computer. Kate Noel of Minneapolis verified this week’s answer in R, while Dean Ballard used Excel:
The 64 shaded cells illustrate the 64 cases. For each of the four grids, the number at the top left of each grid represents the length of the first side, the top row is the length of the second side and the first column is the length of the third. Sure enough, among the 64 cases, there were 22 that resulted in a triangle.
Solution to last week’s Riddler Classic
Congratulations to ÑÑâÐSeth Kadish ÑÑâÐ of Portland, Oregon, winner of last week’s Riddler Classic.
On Feb. 23, baseball statistician Jim Passon tweeted out some recent stats for baseball’s God of WAR, Mike Trout:
Yes, Trout’s numbers were gaudy. But what caught social media’s attention was that each stat (batting average, on-base percentage, slugging percentage and OPS) somehow also corresponded to the number of games over which Trout averaged those stats. For example, Trout batted .299 over his last 299 games. Could this possibly be a coincidence?
If you thought about it for a minute, you realized that there was nothing magical at all about having a batting average that matched a corresponding number of games.
And I wrote last week, suppose a baseball player has four at-bats per game (not including walks). Their batting average is the number of hits they got divided by four times the number of games they played. For many numbers of games, it was possible to have a corresponding batting average that, when rounded to three digits, equaled the number of games divided by 1,000. For example, if a player typically gets one hit per game in their at-bats, then they could very well have a .250 average over 250 games.
What was the greatest number of games for which it was not possible to have a matching rounded batting average? Again, you were asked to assume four at-bats per game.
The way the question was worded — asking for the greatest number of games rather than the greatest possible batting average — technically allowed for answers greater than 1,000. It is true that there’s no way for you to bat 1.001 over your last 1,001 games. Without constraining answers to possible batting averages, there was no upper bound, which made the riddle meaningless. Thanks to all who pointed this out — but I did not accept this answer. (You are welcome to challenge the call.)
The more interesting mathematics occurred for batting averages that were possible. Over the course of g games, you had 4g at-bats. If h of these resulted in hits, then your batting average was h/(4g). Meanwhile, the question was asking when g was or was not 1,000 times greater than the rounded batting average, which was 1,000×h/(4g), or 250h/g.
So to achieve a batting average that matched g games, you needed to have approximately g2/250 hits. The number of hits had to be a whole number, so you wanted to have round(g2/250) hits, where “round” is a function that rounds to the nearest integer. In the end, the expression for your batting average, rounded to three decimal places and multiplied by a thousand, was round(250/g×round(g2/250)). This was a neat function to explore — for greater values of g, it simply equaled g. However, for smaller values, it was hit or miss.
For example, there was clearly no way to bat 0.010 in 10 games. That would have meant you had just 40 at-bats, so the lowest nonzero average you could have had was 0.025 based on a single hit. In the end, the greatest value of g without a corresponding average was 239, when the aforementioned function returned an oh-so-close value of 238.
Solver Mark Girard went ahead and found every number of games (less than 1,000, of course) that lacked a matching batting average:
Solver David Ding further explored how this maximum changed with the average number of at-bats per game. Over a reasonable range, this maximum turned out to be approximately 1,000 divided by the number of at-bats per game.
The irony in all of this was that it was not mathematically impressive that a baseball player of Trout’s skill was able to produce a batting average that matched the number of games played. It would have been less likely for a player with a low batting average to have accomplished the same feat.
And that’s something most of us can do that Mike Trout can’t.
Want more riddles?
Well, aren’t you lucky? There’s a whole book full of the best puzzles from this column and some never-before-seen head-scratchers. It’s called “The Riddler,” and it’s in stores now!
Want to submit a riddle?
Email Zach Wissner-Gross at email@example.com.