The Ultimate Matrix

Calculus Level 5

lim n [ 1 2 1 2 0 0 0 1 2 1 2 0 0 0 1 2 1 2 1 4 1 4 0 1 2 ] n \displaystyle\lim_{n\to\infty} \begin{bmatrix} 1\over 2 & 1\over 2 & 0 & 0 \\ 0 & 1\over 2 & 1\over 2 & 0 \\ 0 & 0 & 1\over 2 & 1\over 2 \\ 1\over 4 & 1\over 4 & 0 & 1\over 2 \\ \end{bmatrix}^ n

The matrix formed from the limit above has elements that can be expressed as b i j c \dfrac{b_{ij}}c , where b i j b_{ij} and c c are integers. Find the minimum positive value of c c .


The answer is 7.

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

Richard Xu
Apr 2, 2018

Let the results be

[ v 1 v 2 v 3 v 4 ] \begin{bmatrix} v_1 \\ v_2\\v_3\\v_4 \end{bmatrix}

where v 1 , v 2 , v 3 , v 4 v_1,v_2,v_3,v_4 are row vectors.

Pre-multiply with the base matrix:

{ 1 2 v 1 + 1 2 v 2 = v 1 1 2 v 2 + 1 2 v 3 = v 2 1 2 v 3 + 1 2 v 4 = v 3 1 4 v 1 + 1 4 v 2 + 1 2 v 4 = v 4 v 1 = v 2 = v 3 = v 4 = v \left\{ \begin{aligned} \frac{1}{2}v_1+\frac{1}{2}v_2=v_1 \\ \frac{1}{2}v_2+\frac{1}{2}v_3=v_2 \\\frac{1}{2}v_3+\frac{1}{2}v_4=v_3\\\frac{1}{4}v_1+\frac{1}{4}v_2+\frac{1}{2}v_4=v_4 \end{aligned}\right. \Rightarrow v_1=v_2=v_3=v_4=v

Let v = [ x 1 , x 2 , x 3 , x 4 ] v = [x_1,x_2,x_3,x_4]

Post-multiply with the base matrix: { 1 2 x 1 + 1 4 x 4 = x 1 1 2 x 1 + 1 2 x 2 + 1 4 x 4 = x 2 1 2 x 2 + 1 2 x 3 = x 3 1 2 x 3 + 1 2 x 4 = x 4 x 1 + x 2 + x 3 + x 4 = 1 { x 1 = 1 7 x 2 = x 3 = x 4 = 2 7 \left\{ \begin{aligned} \frac{1}{2}x_1+\frac{1}{4}x_4=x_1 \\ \frac{1}{2}x_1+\frac{1}{2}x_2+\frac{1}{4}x_4=x_2 \\\frac{1}{2}x_2+\frac{1}{2}x_3=x_3\\\frac{1}{2}x_3+\frac{1}{2}x_4=x_4 \\x_1+x_2+x_3+x_4=1\end{aligned}\right. \Rightarrow \left\{\begin{aligned} x_1=\frac{1}{7} \\ x_2=x_3=x_4=\frac{2}{7} \end{aligned}\right.

The last equation is due to the fact that the product of transition matrices is still a transition matrix.

I've changed the question. How do you solve it now?

Digvijay Singh - 3 years, 2 months ago

Log in to reply

Please refer to the edited solution~

Richard Xu - 3 years, 2 months ago
Kelvin Hong
May 18, 2018

I use the python code below, and yields the answer 7 \boxed7

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
class Matrix:
    def __init__(self, array_list):
        self.array_list = array_list
        self.row = len(array_list)
        self.column = len(array_list[0])
        for i in range(1, self.row):
            if len(array_list[i]) != self.column:
                raise IndexError
    def __mul__(self, other):
        if self.column != other.row:
            print ('Matrices can\'t be multiplied')
            print ('Error: First matrix\'s column number isn\'t equal to second matrix\'s row number.')
        list_answer = []
        for i in range(self.row):
            list_a_row = []
            for j in range(other.column):               
                element = 0
                for k in range(self.column):                    
                    element = element + self.array_list[i][k] * other.array_list[k][j]
                list_a_row.append(element)
            list_answer.append(list_a_row)
        return Matrix(list_answer)
    def visualize(self):
        row = self.row
        for i in range(row):
            print ('|' + str(tuple(self.array_list[i])) + '|')
    @classmethod
    def matrix_generator(cls, row, column):
        list_ = []
        for i in range(row):
            row_list = []
            for j in range(column):
                row_list.append(random.randint(-10,10))
            list_.append(row_list)
        return cls(list_)
mat = Matrix([[0.5,0.5,0,0],[0,0.5,0.5,0],[0,0,0.5,0.5],[0.25,0.25,0,0.5]])
def mat_exponent(mat, exp):
    cache = mat
    for i in range(2,exp+1):
        cache = cache*mat
    return cache
mat_exponent(mat,1000).visualize()
Output-
|(0.14285714285714285, 0.2857142857142857, 0.2857142857142857, 0.2857142857142857)|
|(0.14285714285714285, 0.2857142857142857, 0.2857142857142857, 0.2857142857142857)|
|(0.14285714285714285, 0.2857142857142857, 0.2857142857142857, 0.2857142857142857)|
|(0.14285714285714285, 0.2857142857142857, 0.2857142857142857, 0.2857142857142857)|

Why didn't you use library such as NumPy?

Micah Wood - 3 years ago

Log in to reply

I didn't learn too much in python, just some basic.

Kelvin Hong - 3 years ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...