The Riddler: Santa Needs Some Help With Math

For the last Riddler of the year I attempt to solve both the Express and Classic Riddlers!

Riddler Express: How Long Will it Take Santa to Place his Reindeer?

We need to find out how long it will take Santa to place his reindeer in the correct sled positions, if he proceeds at random. It takes a minute to harness a raindeer, and the raindeer will grunt to indicate it’s in the right position.

Thinking in terms of a probabiity tree, if we consider the first position in the sled, the expected time that it will take to place the raindeer correctly looks like this:

The expected time that it will take for the first raindeer placed correctly is the sum of all the paths leading to the green circles. For example:

This process can be repeated for each of the eight deer, with the tree getting one branch shorter for each deer that has been correctly placed. The expected time to place all eight deer when then be the sum of the expected time for each deer:

To generalize this problem to a sled with N deer, I coded the expected time in R as follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
raindeer <- function(N) {
 if (N==2) return(3/2)
 if (N==1) return(1) 
 n <- N
 t <- 2
 T <- (1/n)
 while (n>2) {
 T <- T + ( prod(seq(N-1,2)[1:(t-1)]) / prod(seq(N,3)[1:(t-1)]) ) * ((1/(n-1))*t)
 t <- t+1
 n <- n-1
 }
 T <- T + ( prod(seq(N-1,2)[1:(t-2)]) / prod(seq(N,3)[1:(t-2)]) ) * ((1/(n))*t)
 T
}

sled <- function(N) sum(sapply(1:N, raindeer))

sled(8)

[1] 22

So it will take Santa about 22 minutes to get his sled ready to go.

Related