Tetrahedron hopping

Every move a frog jumps from one vertex of a tetrahedron to another vertex. Suppose he starts at a certain vertex... Call it A. How many different ways are there for it to wind up on A, the same vertex as he started, given that he makes 17 jumps in all?


Image credit: commons.wikimedia.org


The answer is 32285040.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Geoff Pilling
Aug 17, 2016

Let N A B ( n ) N_{AB}(n) be the number of ways to go from one vertex to a different one in n n moves.

Let N A A ( n ) N_{AA}(n) be the number of ways to go from one vertex to the same one in n n moves.

Then, clearly N A B ( 1 ) = 1 N_{AB}(1) = 1 and N A A ( 1 ) = 0 N_{AA}(1) = 0

Also, for n > 1 n>1 , N A B ( n ) = N A B ( n 1 ) + 2 N A A ( n 1 ) N_{AB}(n) =N_{AB}(n-1)+2*N_{AA}(n-1) and N A A ( n ) = 3 N A B ( n 1 ) N_{AA}(n) = 3*N_{AB}(n-1)

From this, it follows (proof left as an exercise to the reader! ;) ) that for odd n n , N A A ( n ) = ( 3 n 3 ) / 4 N_{AA}(n) = (3^n-3)/4 , and for even n n , N A A ( n ) = ( 3 n + 3 ) / 4 N_{AA}(n) = (3^n+3)/4

Using these relations, we find that, N A A ( 17 ) = 32285040 N_{AA}(17) = \boxed{32285040}

Can you explain how you immediately got your last line from your second last line?

Pi Han Goh - 4 years, 10 months ago

Log in to reply

@Geoff Pilling The recurrence relations can be combined to obtain N A A ( n + 2 ) 2 N A A ( n + 1 ) 3 N A A ( n ) = 0 N_{AA}(n+2) - 2N_{AA}(n+1) - 3N_{AA}(n) = 0 This sort of recurrence relation is a discrete version of a second order ODE with constant coefficients, and is solved similarly. If we try N A A ( n ) = λ n N_{AA}(n) = \lambda^n , then this recurrence relation is satisfied for all n n provided that λ 2 2 λ 3 = 0 \lambda^2 - 2\lambda - 3 = 0 , namely provided that λ = 3 \lambda = 3 or 1 -1 . Thus the general solution of the recurrence relation is N A A ( n ) = α 3 n + β ( 1 ) n N_{AA}(n) \; = \; \alpha 3^n + \beta (-1)^n and we choose constants α , β \alpha,\beta to ensure that N A A ( 1 ) = 0 N_{AA}(1) = 0 and N A A ( 2 ) = 3 N A B ( 1 ) = 3 N_{AA}(2) = 3N_{AB}(1) = 3 . Thus N A A ( n ) = 1 4 [ 3 n + 3 ( 1 ) n ] N_{AA}(n) \; =\; \tfrac14\big[3^n + 3(-1)^n\big] This method improves on induction, since you don't have to know the answer first!

The method can be generalised to cope with the case where the quadratic in λ \lambda has repeated roots, and also for recurrence relations of higher order.

Alternatively you can regard this as an order one recurrence relation in the vector quantity x n = ( N A A ( n ) N A B ( n ) ) \mathbf{x}_n \; = \; \left(\begin{array}{c}N_{AA}(n) \\ N_{AB}(n) \end{array} \right) obtaining a recurrence relation of the form x n + 1 = A x n \mathbf{x}_{n+1} \; = \; A\mathbf{x}_n for a suitable 2 × 2 2 \times 2 matrix A A . By considering eigenvalues and eigenvectors of A A , you can solve this recurrence relation for x n \mathbf{x}_n .

Mark Hennings - 4 years, 9 months ago

Log in to reply

Okay, I'm weak in matrix theory, but is the full explanation for your sentence (below) longer than Samrat Mukhopadhyay's solution (below)? I'm not sure if there are a lot of prerequisites to learn or not...

Alternatively you can regard this as an order one recurrence relation...

... you can solve this recurrence relation for x n \mathbf x _n

Pi Han Goh - 4 years, 9 months ago

Log in to reply

@Pi Han Goh Mine is a bit shorter, since the matrix is only 2 × 2 2\times2 . We have x n + 1 = ( 0 3 1 2 ) x n \mathbf{x}_{n+1} \; =\; \left(\begin{array}{cc} 0 & 3 \\ 1 & 2 \end{array}\right)\,\mathbf{x}_n and the 2 × 2 2\times2 matrix has eigenvalues 3 , 1 3,-1 and corresponding eigenvectors ( 1 1 ) \binom{1}{1} , ( 3 1 ) \binom{3}{-1} . With a bit more work we can find α , β \alpha,\beta such that x n = α 3 n ( 1 1 ) + β ( 1 ) n ( 3 1 ) \mathbf{x}_n \; = \; \alpha 3^n \binom{1}{1} + \beta (-1)^n \binom{3}{-1}

Mark Hennings - 4 years, 9 months ago

I plugged into the recurrence relation:

N A A ( 17 ) = 3 N A B ( 16 ) = 3 ( N A B ( 15 ) + 2 N A A ( 15 ) ) = 3 ( N A B ( 14 ) + 2 N A B ( 14 ) + 2 ( 3 N A B ( 14 ) ) ) = . . . N_{AA}(17) = 3*N_{AB}(16) = 3*(N_{AB}(15) + 2*N_{AA}(15)) = 3*(N_{AB}(14)+2*N_{AB}(14) + 2*(3*N_{AB}(14))) = ...

Is this what you meant, or did you want me to explain how I derived the second to last line (the recurrence relation)?

Geoff Pilling - 4 years, 10 months ago

Log in to reply

That is very tedious. Did you use a computer to do it? Or is there a non-CAS approach?

Pi Han Goh - 4 years, 10 months ago

Log in to reply

@Pi Han Goh Well, I noticed (without proving it) that for odd n n , N A A ( n ) = ( 3 n 3 ) / 4 N_{AA}(n) = (3^n-3)/4 , and for even n n , N A A ( n ) = ( 3 n + 3 ) / 4 N_{AA}(n) = (3^n+3)/4

I've added this to the solution! ;)

At first I hesitated, since I didn't have a proof for it. (But I verified that its correct - at least up through 20 - using a spreadsheet ;^) )

Geoff Pilling - 4 years, 10 months ago

Log in to reply

@Geoff Pilling Well, it's simplest to prove it via induction , right? ;)

Pi Han Goh - 4 years, 10 months ago

Log in to reply

@Pi Han Goh Ah yes... I suppose it is! :)

Geoff Pilling - 4 years, 10 months ago

Here is how I went about it. And, I get a different answer. Would like to know where I am going wrong.

Interesting thing about the tetrahedron is every vertex is connected to every other vertex. So, at each jump-point, the frog has the option to go to all the three available vertices (when he is standing on the fourth).

So, if he is going on a 17-step adventure, and we are looking for number of ways to return where he started, it basically means, we can plot the path as (assuming the tetrahedron is labelled ABCD) : A x x x x x x x x x x x x x x x x A. where A is the starting vertex, x is any of the available vertices, A is the ending vertex. So, the number of possibilities for each x is 3, and so the final answer should be 3^16 = 43046721

Where am I going wrong?

Rajendran Dandapani - 4 years, 9 months ago

Log in to reply

Of the 3 n 3^n possible n n -step journeys, N A A ( n ) N_{AA}(n) of them end up at A.

There are 3 3 ways in which an n n -step journey ending at A can be extended into an ( n + 2 ) (n+2) -step journey ending at A

There are 2 2 ways in which an n n -step journey not ending at A can be extended into an ( n + 2 ) (n+2) -step journey ending at A (the ( n + 1 ) (n+1) st step cannot visit A).

Thus N A A ( n + 2 ) = 3 N A A ( n ) + 2 [ 3 n N A A ( n ) ] = N A A ( n ) + 2 × 3 n N_{AA}(n+2) \; = \; 3 N_{AA}(n) + 2\big[3^n - N_{AA}(n)\big] \; = \; N_{AA}(n) + 2 \times 3^n With N A A ( 1 ) = 0 N_{AA}(1) =0 and N A A ( 2 ) = 3 N_{AA}(2) = 3 , we can solve the above recurrence relation (once for odd n n and then once for even n n ) to get N A A ( n ) = 1 4 [ 3 n + 3 ( 1 ) n ] N_{AA}(n) \; = \; \tfrac14\big[3^n + 3(-1)^n \big]

Mark Hennings - 4 years, 9 months ago

Log in to reply

Nicely put, @Mark Hennings !

Geoff Pilling - 4 years, 9 months ago

Well, some of those won't work since his sixteenth jump will sometimes wind up on A, which means there is no way the 17th jump will wind him up on A.

Geoff Pilling - 4 years, 9 months ago

Actually, the recurrence relation is N A B ( n ) = 2 N A B ( n 1 ) + N A A ( n 1 ) N_{AB}(n) = 2N_{AB}(n-1) + N_{AA}(n-1) Note the different place for the coefficient 2 2 . Remember that N A B ( n ) N_{AB}(n) is the number of ways of getting from A A to any specific one of the other three vertices (it is the same for all three vertices). Thus there are 2 2 ways of getting to an "other" vertex in n n moves if the penultimate vertex was also an "other" vertex, and only 1 1 way of getting to a (specific) "other" vertex if the penultimate vertex was A.

Mark Hennings - 4 years, 9 months ago

A general procedure:

Note that we can construct an adjacency matrix A A corresponding to the graph represented by the tetrahedron, where A i j = 1 A_{ij}=1 if i j i\ne j and there is an edge between them; A i j = 0 A_{ij}=0 , else. So the adjacency matrix for the tetrahedron is the following A = ( 0 1 1 1 1 0 1 1 1 1 0 1 1 1 1 0 ) A=\begin{pmatrix} 0 & 1 & 1 & 1\\ 1 & 0 & 1 & 1\\ 1 & 1 & 0 & 1\\ 1 & 1 & 1 & 0 \end{pmatrix} Claim:The ( i , j ) (i,j) th entry of A n A^n , gives the number of n n length paths from i i to j j in the graph corresponding to A A .

Proof Clearly the claim is true for n = 1 n=1 . Let it be true for n = k , k 1 n=k, k\ge 1 . Now, note that A i j k + 1 = l A k i l A l j A^{k+1}_{ij}=\sum_{l}A^k{il}A_{lj} . Now, note that by induction hypothesis, A i l k A l j A^k_{il}A_{lj} denotes the total number of k + 1 k+1 length paths from i i to j j , by first going from i i to l l in k k steps and then going from l l to j j in one step. Thus, A i j k + 1 A^{k+1}_{ij} gives all possible k + 1 k+1 length paths from i i to j j . Thus the claim is proved. \blacksquare

It is now clear that in our case, we need to find a diagonal element of A 17 A^{17} . To do that, first observe that one can write, A = 1 1 T I A=11^T-I , where 1 = [ 1 1 1 1 ] 1=[1\ 1\ 1\ 1] is the all 1 1 vector, and I I is the 4 × 4 4\times 4 identity matrix. Since, A A is symmetric, A A admits a unique diagonalization, i.e. A A can be written uniquely as A = V Λ V T A=V\Lambda V^T , where Λ \Lambda is a diagonal matrix with the diagonal consisting of eigenvalues of A A , and V V is an orthonormal matrix with a set of eigenvectors of A A as its columns.

For our case, it is easy to check that 1 1 T 11^T has one eigenvalue 4 4 , and others 0 0 , so the eigenvalue matrix of A A is Λ I \Lambda-I , where Λ = ( 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ) \Lambda=\begin{pmatrix} 4 & 0 & 0 & 0\\ 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 \end{pmatrix} The orthonormal eigenvector corresponding to eigenvalue 3 3 of 1 1 T 11^T is also easy to see to be 1 / 2 1/2 times the vector 1 1 . Now, because of orthonormality of V V , we see that A 2 = ( V ( Λ I ) V T ) 2 = V ( Λ I ) V T V ( Λ I ) V T = V ( Λ I ) 2 V T , A n = V ( Λ I ) n V T A^2=(V(\Lambda-I)V^T)^2=V(\Lambda-I)V^TV(\Lambda-I)V^T=V(\Lambda-I)^2V^T,\cdots\ A^n=V(\Lambda-I)^n V^T Thus, writing the columns of V V as e 1 , e 2 , e 3 , e 4 e_1,e_2,e_3,e_4 , corresponding to the eigenvalues of 4 , 0 , 0 , 0 4,0,0,0 , we get A n = 3 n e 1 e 1 T + ( 1 ) n ( k = 2 4 e k e k T ) = 3 n e 1 e 1 T + ( 1 ) n ( k = 1 4 e k e k T e 1 e 1 T ) = 3 n e 1 e 1 T + ( 1 ) n ( V V T e 1 e 1 T ) = ( 3 n ( 1 ) n ) e 1 e 1 T + ( 1 ) n I = ( 3 n ( 1 ) n ) 4 1 1 T + ( 1 ) n I A^n=3^ne_1e_1^T+(-1)^n (\sum_{k=2}^4 e_ke_k^T)\\=3^ne_1e_1^T+(-1)^n(\sum_{k=1}^4 e_ke_k^T-e_1e_1^T)\\=3^ne_1e_1^T+(-1)^n(VV^T-e_1e_1^T)\\=(3^n-(-1)^n)e_1e_1^T+(-1)^n I\\=\frac{(3^n-(-1)^n)}{4} 11^T+(-1)^n I Thus, for n = 17 n=17 , any diagonal element is ( 3 17 + 1 ) / 4 1 = 32285040 (3^{17}+1)/4-1=\boxed{32285040} .

Nice write up @Samrat Mukhopadhyay !

Geoff Pilling - 4 years, 9 months ago

Log in to reply

Thank you.

Samrat Mukhopadhyay - 4 years, 9 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...