Riddler Express
I have a spherical pumpkin. I carefully calculate its volume in cubic inches, as well as its surface area in square inches.
But when I came back to my calculations, I saw that my units β the square inches and the cubic inches β had mysteriously disappeared from my calculations. But it didnβt matter, because both numerical values were the same!
What is the radius of my spherical pumpkin?
Extra credit: Letβs dispense with 3D thinking. Instead, suppose I have an -hyperspherical pumpkin. Once again, I calculate its volume (with units ) and surface area (with units ). Miraculously, the numerical values are once again the same! What is the radius of my -hyperspherical pumpkin?
Solution
Let be the radius of the spherical pumpkin. We have
The recurrence relation for the surface area of an -ball is given by
If , we have .
Riddler Classic
Congratulations, youβve made it to the fifth round of The Squiddler β a competition that takes place on a remote island. In this round, you are one of the remaining competitors who must cross a bridge made up of pairs of separated glass squares. Here is what the bridge looks like from above:
To cross the bridge, you must jump from one pair of squares to the next. However, you must choose one of the two squares in a pair to land on. Within each pair, one square is made of tempered glass, while the other is made of normal glass. If you jump onto tempered glass, all is well, and you can continue on to the next pair of squares. But if you jump onto normal glass, it will break, and you will be eliminated from the competition.
You and your competitors have no knowledge of which square within each pair is made of tempered glass. The only way to figure it out is to take a leap of faith and jump onto a square. Once a pair is revealed β either when someone lands on a tempered square or a normal square β all remaining competitors take notice and will choose the tempered glass when they arrive at that pair.
On average, how many of the competitors will survive and make it to the next round of the competition?
Computational Solution
Let be the expected number of survivors when there are competitors and pairs of glasses. We have the recurrence relation
The Python code to compute is given below:
def S(n , m):
if n == 0:
return 0
if m == 0:
return n
return 0.5*S(n, m-1) + 0.5*S(n-1, m-1)
On average, if there are competitors and pairs of glasses, we will have survivors.