# How Many Rectangles Can You Make?

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 or send me an email.

## Riddler Express

You have four squares that you can place on a large, flat table. You can place the squares so that their edges align, but their interiors cannot overlap.

Your goal is to position the squares so that you can trace as many rectangles as possible using the edges of the squares. For example, if you had two squares instead of four, you could place the squares side by side, as shown below:

With this arrangement, itâ€™s possible to trace three rectangles: the square on the left, the square on the right and the larger rectangle around both squares. How would you arrange four squares to get as many rectangles as possible? And what is this number of rectangles?

## Riddler Classic

From Nicola Paciolla comes a game that you can win (or more likely lose?) all by yourself:

Thereâ€™s a version of solitaire played in southern Italy with a deck of 40 Neapolitan cards, with four suits numbered from 1 to 10. The deck is shuffled and then cards are turned over one at a time. Flipping over the first card you say â€śone,â€ť the second card â€śtwoâ€ť and the third card â€śthree.â€ť You repeat this, saying â€śoneâ€ť for the fourth card, â€śtwoâ€ť for the fifth card and â€śthreeâ€ť for the sixth card. You continue your way through the deck, until you at last say â€śoneâ€ť for the 40th card.

If at any point the number you say matches the value of the card you flip over, you lose.

What is your probability of winning the game?

## Solution to the last Riddler Express

Congratulations to đź‘Ź Kiera Jones đź‘Ź of Cincinnati, Ohio, winner of last weekâ€™s Riddler Express.

Last week, you had to find all pairs of integers *a* and *b* that are solutions to the following equation: *a*Â·(*a*+1)Â·(*a*+2) = *b*^{2}+4.

That was the entire riddle. It was short and sweet.

While it might have been tempting to go down a rabbit hole of algebra, expanding the cubic expression on the left and equating it to the quadratic on the right was no picnic. There was a simpler way, using ideas from number theory.

There were a few things you could immediately tell about the expression on the left, *a*Â·(*a*+1)Â·(*a*+2). For one, it had to be an even number. If *a* was even, then the product was also even, since an integer with an even factor must also be even. And if *a* was odd, then *a*+1 was even, again ensuring that the overall product was even.

You similarly knew that *a*Â·(*a*+1)Â·(*a*+2) was divisible by 3. That was because exactly one of the three factors had to be a multiple of 3. In number theory parlance, either *a* was a multiple of 3, *a* was congruent to 1 (mod 3),^{2} in which case *a*+2 was a multiple of 3, or *a* was congruent to 2 (mod 3), in which case *a*+1 was a multiple of 3.

Finally, since *a*Â·(*a*+1)Â·(*a*+2) was a multiple of both 2 and 3, that meant it was also a multiple of 6. In terms of factors, that was everything you could say for sure about the left side of the equation.

Now what about the right side? At first, it wasnâ€™t immediately clear how *b*^{2}+4 might have related to factors of 2, 3 or 6. But letâ€™s take a look. If *b* was odd, then *b*^{2} was also odd, as was *b*^{2}+4. Conversely, if *b* was even, then so were *b*^{2} and *b*^{2}+4. Since *a*Â·(*a*+1)Â·(*a*+2) was guaranteed to be even, that meant any solution had to have an even value for *b*.

If *b* was a multiple of 3, then so was *b*^{2}, which meant *b*^{2}+4 was congruent to 1 (mod 3). If *b *was congruent to 1 (mod 3), then so was *b*^{2}, which meant *b*^{2}+4 was congruent to 2 (mod 3). Finally, if *b *was congruent to 2 (mod 3), then *b*^{2} was again congruent to 1 (mod 3), which meant *b*^{2}+4 was congruent to 2 (mod 3). In other words, *b*^{2}+4 was *never* congruent to 0 (mod 3). If youâ€™re not convinced, check the values of *b*^{2}+4 for different integer values of *b*. Sure enough, itâ€™s never a multiple of 3!

At this point, you knew the left side of the equation had to be a multiple of 3. Meanwhile, the right side of the equation couldnâ€™t be a multiple of 3. Therefore, this equation had **no integer solutions**. Sometimes the answer â€¦ is that there is no answer.

## Solution to the last Riddler Classic

Congratulations to đź‘Ź Michael Seifert đź‘Ź of Quaker Hill, Connecticut, winner of last weekâ€™s Riddler Classic.

Last week, on a cloudless night, the sky above you contained an equal number of visible stars and planes. Suddenly, you spotted a point of light at a particular angle of elevation above the horizon. Based purely on this angle, you wanted to determine whether the point of light was more likely to be a star or a plane.

While figuring this out, you made the following simplifying assumptions:

- Earth was a perfect sphere with a radius of 4,000 miles.
- Stars were equally likely to be anywhere in the night sky.
- Planes were equally likely to be flying anywhere over Earth (i.e., not just limited to established air routes) at an altitude of 6 miles. You could neglect takeoffs and landings.

After some quick thinking, you realized that at this particular angle, the point of light was equally likely to be a star or a plane. What was this angle of elevation?

This was a hard one!

Before getting into the math, letâ€™s first try to understand whatâ€™s going on at a more qualitative level and convince ourselves that there *is* a solution. To do that, itâ€™s helpful to reduce the problem from three dimensions to two. That is, suppose Earth is a *circle* (rather than a sphere) with a radius of 4,000 miles. Planes fly around a concentric circle with a radius of 4,006 miles. And the stars lie on a third concentric circle with a radius that is effectively infinite.

In this two-dimensional scenario, where in the sky were you more likely to see stars? Where were you more likely to see planes? As an illustration, the diagram below (not to scale) shows where planes appear at an angle of elevation above or below 45 degrees. While stars had an equal chance of being above or below this angle (again, in *two* dimensions), the same wasnâ€™t true for planes. Of the portion of the 4,006-mile radius circle that was visible from the surface of the 4,000-mile radius circle, much of it was closer to the horizon. In fact, only about 3 percent of planes had an angle of elevation greater than 45 degrees, with the remaining 97 percent at lower angles.

The same phenomenon occurred in three dimensions. Once again, planes were more likely than stars to be closer to the horizon, while stars were more likely than planes to occur at higher angles. Solver Josh Silverman generated the following graph, which showed the probability distributions by angle of elevation for both stars (dashed black line) and planes (solid yellow line). Note that these distributions didnâ€™t account for the fact that there was more spherical space at lower angles â€” but for comparative purposes, this omission didnâ€™t matter.

Since the puzzle stated that there were an equal number of visible stars and planes in the sky, the intersection in the graph was precisely the angle at which the point was equally likely to be a star or a plane. Reading off the graph, this angle of elevation was approximately 0.1 radians, or about 6 degrees.

For those of you who went through the detailed calculus to determine these distributions as well as their intersection, I salute you! But I wonâ€™t be working through that derivation here. Instead, I would like to point readers to some excellent write-ups by Riddler Nation, including those of Josh, Peter Ji and Starvind. For the analytically inclined, the more precise answer turned out to be about **6.065 degrees**.

Of course, there are other, more practical ways to distinguish stars and planes in the night sky. Planes visibly move and also have blinking lights. Orbiting satellites are interesting in that they also visibly move but generally donâ€™t blink, as they are visible via reflected sunlight.

In any case, the next time youâ€™re skygazing, keep an eye out for planes, stars and satellites. Unless you live right under a major air route, I bet youâ€™ll see planes closer to the horizon, satellites further away from the horizon, and stars the most evenly distributed throughout the sky. Why? Because math!

## Want more puzzles?

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 riddlercolumn@gmail.com.