Question: a ) Show that the above equation can be written in the form of a matrix such that ( S , N ) is S

a) Show that the above equation can be written in the form of a matrix such that (S,N) is
Sth element of a 101 matrix N :
(N)=A(N-1)
Once (N) is calculated, (S,N) can be found by reading Sth element of (N) matrix,
(S,N)=(N)S. For instance, 0th element of (2) is (0,2)=1.
Note that (1) corresponds to the starting point before we move to the second digit of the num-
ber. So, It is a 101 matrix with all the elements equal to 1.
(1)=([1],[1],[1],[1],[1],[1],[1],[1],[1],[1])
b) Show that (N) can be found recursively using the following equation:
(N)=AdotsAA(1)=AN-1(1)
That's it! We solved the problem. Let's write a Python code to find (N) for a given N.
c) Create a 1010 NumPy matrix which contains all the elements we have found for A. Find
the transpose of the matrix using numpy.transpose. Are the matrix and its transpose equal?
Did you expect this result?
d) Define a function with the name of "Dialer_Problem" which takes two parameters, S and N
and returns (S,N). Within the function, use a "for loop" to multiply (1) to A and then A
and so on. Test your function for a few examples. For instance, running Dialer_Problem (5,10)
should return 18713.
e) Rewrite the same code without using NumPy package. You will need to create a nested
list which includes all the elements in A and also define a function which performs matrix
multiplication.
a ) Show that the above equation can be written

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!