Riddler Express
Earlier this year, Dakota Jones used a crystal key to gain access to a hidden temple, deep in the Riddlerian Jungle. According to an ancient text, the crystal had exactly six edges, five of which were inch long. Also, the key was the largest such polyhedron (by volume) with these edge lengths.
However, after consulting an expert, Jones realized she had the wrong translation. Instead of definitively having five edges that were inch long, the crystal only needed to have four edges that were inch long. In other words, five edges could have been inch (or all six for that matter), but the crystal definitely had at least four edges that were inch long.
The translator confirmed that the key was indeed the largest such polyhedron (by volume) with these edge lengths.
Once again, Jones needs your help. Now what is the volume of the crystal key?
Solution 1
Given the distances between the vertices of a tetrahedron the volume can be computed using the :
where the subscripts represent the vertices and is the pairwise distance between them β i.e., the length of the edge connecting the two vertices.
If , , be the three edges that meet at a point, and the opposite edges. The volume of the tetrahedron is given by
where
In our case, let , we have
We need to find the value of and that maximizes
Setting the partial derivates and to zero, we get the equations
Therefore, attains the maximum value of when .
References
https://en.wikipedia.org/wiki/Tetrahedron
Solution 2
A polyhedron with edges has to be a tetrahedron. In this particular case, we have a tetrahedron where one face is an equilateral triangle of side length . The volume of tetrahedron (which is a triangular pyramid where the base is an equilateral triangle) is given by
The volume is maximized when the height is maximized i.e. when another edge of length is perpendicular to the base. Therefore the volume of the crystal key is
Riddler Classic
One morning, Phil was playing with my daughter, who loves to cut paper with her safety scissors. She especially likes cutting paper into βstrips,β which are rectangular pieces of paper whose shorter sides are at most inch long.
Whenever Phil gives her a piece of standard printer paper ( inches by inches), she picks one of the four sides at random and then cuts a -inch wide strip parallel to that side. Next, she discards the strip and repeats the process, picking another side at random and cutting the strip. Eventually, she is left with nothing but strips.
On average, how many cuts will she make before she is left only with strips?
Extra credit: Instead of by -inch paper, what if the paper measures by inches? (And for a special case of this, what if the paper is square?)
Computational Solution 1
From the simulation below, we see that the expected number of cuts before we are left only with strips is .
from random import random
def avg_num_cuts_mc(m, n, runs= 1000000):
sum_num_cuts = 0
for _ in range(runs):
num_cuts, cm, cn = 0, m, n
while cm > 1 and cn > 1:
r = random()
if r < 0.5:
cm -= 1
else:
cn -= 1
num_cuts += 1
sum_num_cuts += num_cuts
return sum_num_cuts/runs
print(f"Expected number of cuts is {avg_num_cuts_mc(11, 9)}")
Computational Solution 2
We have the following recurrence relation for the expected number of cuts
with initial conditions .
Solving the recurrence relation using we see that the expected number of cuts is indeed .
def avg_num_cuts_rr(m, n):
C = [[0 for _ in range(n)] for _ in range(m)]
for i in range(1, m):
for j in range(1, n):
C[i][j] = 1 + 0.5*(C[i][j-1] + C[i-1][j])
return C[m-1][n-1]
print(f"Expected number of cuts is {avg_num_cuts_rr(11, 9)}")