Transmutation (Harder Problem)

The same wizard from this problem decides to cast a more complicated transmutation spell, this time with five spell components: copper, tin, silver, lead, and gold. The spell matrix is described below:

[ C t + 1 T t + 1 S t + 1 L t + 1 G t + 1 ] = [ 0.2 0.3 0.025 0.025 0 0.5 0.4 0.025 0.075 0 0.2 0.2 0.8 0.1 0 0.075 0.05 0.05 0.6 0.025 0.025 0.05 0.1 0.2 0.975 ] [ C t T t S t L t G t ] \begin{bmatrix}C_{t + 1} \\ T_{t + 1} \\ S_{t + 1} \\ L_{t + 1} \\ G_{t + 1} \end{bmatrix} = \begin{bmatrix}0.2 & 0.3 & 0.025 & 0.025 & 0 \\ 0.5 & 0.4 & 0.025 & 0.075 & 0 \\ 0.2 & 0.2 & 0.8 & 0.1 & 0 \\ 0.075 & 0.05 & 0.05 & 0.6 & 0.025 \\ 0.025 & 0.05 & 0.1 & 0.2 & 0.975 \end{bmatrix}\ \begin{bmatrix}C_{t} \\ T_{t} \\ S_{t} \\ L_{t} \\ G_{t} \end{bmatrix}

Let [ C T S L G ] \begin{bmatrix} C_{\infty} \\ T_{\infty} \\ S_{\infty} \\ L_{\infty} \\G_{\infty} \end{bmatrix} be the wizard's stockpile of metals if the spell is applied indefinitely.

What is G : ( C + T + S + L ) G_{\infty} : (C_{\infty} +T_{\infty} + S_{\infty} + L_{\infty}) , rounded down?


The answer is 5.

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.

3 solutions

The approach to solving this problem is the same as in the easier version of Transmutation, with the exception that this problem uses a 5x5 matrix instead of a 2x2 matrix. Simply find the eigenvalues and eigenvectors of the matrix, diagonalize the matrix, and find the limit as t t goes to infinity. The code at the very bottom does this process, substituting infinity for a really large value. This isn't a formal proof of the answer, but it gets the job done.

Running the code yields the following matrix:

[ 0.01186944 0.01186944 0.01186944 0.01186944 0.01186944 0.02077151 0.02077151 0.02077151 0.02077151 0.02077151 0.0652819 0.0652819 0.0652819 0.0652819 0.0652819 0.0652819 0.0652819 0.0652819 0.0652819 0.0652819 0.83679527 0.83679527 0.83679527 0.83679527 0.83679527 ] \begin{bmatrix} 0.01186944 & 0.01186944 & 0.01186944 & 0.01186944 & 0.01186944 \\ 0.02077151 & 0.02077151 & 0.02077151 & 0.02077151 & 0.02077151 \\ 0.0652819 & 0.0652819 & 0.0652819 & 0.0652819 & 0.0652819 \\ 0.0652819 & 0.0652819 & 0.0652819 & 0.0652819 & 0.0652819 \\ 0.83679527 & 0.83679527 & 0.83679527 & 0.83679527 & 0.83679527 \end{bmatrix}

Which corresponds to the following set of equations:

Σ = C + T + S + L + G \Sigma_{\infty} = C_{\infty} + T_{\infty} + S_{\infty} + L_{\infty} + G_{\infty}

C = 0.01186944 Σ C_{\infty} = 0.01186944\Sigma_{\infty}

T = 0.02077151 Σ T_{\infty} = 0.02077151\Sigma_{\infty}

S = 0.0652819 Σ S_{\infty} = 0.0652819\Sigma_{\infty}

L = 0.0652819 Σ L_{\infty} = 0.0652819\Sigma_{\infty}

G = 0.83679527 Σ G_{\infty} = 0.83679527\Sigma_{\infty}

Thus, the answer is G C + T + S + L = 5 \left \lfloor{\frac{G_{\infty}}{C_{\infty} + T_{\infty} + S_{\infty} + L_{\infty}}} \right \rfloor = \boxed{5}

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
import numpy as np

A = np.asarray([[0.2,0.3,0.025,0.025,0],
                [0.5,0.4,0.025, 0.075,0],
                [0.2,0.2,0.8,0.1,0],
                [0.075,0.05,0.05,0.6,0.025],
                [0.025,0.05,0.1,0.2,0.975]])

eigenvalues, eigenvectors = np.linalg.eig(A)

def f(t):
    D = np.diag([x ** t for x in eigenvalues])
    P = eigenvectors
    P_inv = np.linalg.inv(P)
    return np.matmul(P, np.matmul(D, P_inv))

inf_matrix = f(10000000)
print(inf_matrix)

Abhishek Sinha
Mar 29, 2020

The problem immediately reduces to finding the stationary distribution of a Markov chain with the kernel given by P = Q T \bm{P}=\bm{Q}^T , where Q \bm{Q} is the given coefficient matrix. It can be easily verified that the chain is ergodic (i.e., irreducible and aperiodic). Hence, the unique stationary distribution is obtained by solving the balance equation π P = π . \bm{\pi} \bm{P}=\bm{\pi}. By solving the above system of linear equations with the constraint that i π i = 1 \sum_i \pi_i=1 , we obtain the following stationary distribution π = [ 0.0119 , 0.0208 , 0.0653 , 0.0653 , 0.8368 ] . \bm{\pi}= [0.0119, 0.0208, 0.0653, 0.0653, 0.8368]. From which, the answer follows.

Saya Suka
Mar 29, 2020

I got an answer of 5.12727273.

Sorry about that! In a previous edit of this problem I meant to add "rounded down" to the end of the problem. It has now been added. Thanks for pointing this out and I apologize for the confusion.

Alexander McDowell - 1 year, 2 months ago

C : T : S : L : G = 4 : 7 : 22 : 22 : 282

Saya Suka - 1 year, 2 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...