• We are pleased to announce that the winner of our Feedback Prize Draw for the Winter 2024-25 session and winning £150 of gift vouchers is Zhao Liang Tay. Congratulations to Zhao Liang. If you fancy winning £150 worth of gift vouchers (from a major UK store) for the Summer 2025 exam sitting for just a few minutes of your time throughout the session, please see our website at https://www.acted.co.uk/further-info.html?pat=feedback#feedback-prize for more information on how you can make sure your name is included in the draw at the end of the session.
  • Please be advised that the SP1, SP5 and SP7 X1 deadline is the 14th July and not the 17th June as first stated. Please accept out apologies for any confusion caused.

Matrix multiplication - speed

E

Ex-muso

Member
Q3.5
By working out all possible paths, calculating probabilities and summing I can get the required answer quickly.

However, using the recommended method of post-multiplying the vector by the transition matrix until reaching n+5, I find it takes way longer and I feel far more likely to make a mistake too. I feel like i must be missing something on multiplying matrices at speed. Could someone enlighten me?
 
Q3.5
By working out all possible paths, calculating probabilities and summing I can get the required answer quickly.

However, using the recommended method of post-multiplying the vector by the transition matrix until reaching n+5, I find it takes way longer and I feel far more likely to make a mistake too. I feel like i must be missing something on multiplying matrices at speed. Could someone enlighten me?

But how are you calculating P^5?

I think the fastest way is to calculate P^2 and P^3 and then only calculate the required value in P^5.
 
Thanks for the reply.

Your suggested approach looks like the second approach in the course notes solutions. This, for me, is still much slower than the other method I described. As I said, I must be missing something in the speed at which matrices can be multiplied.
 
If there are a small number of states and the transitions are straightforward, yes, it *can* be faster to calculate them directly, especially if the matrix is sparse.

The danger is that you have to make sure you've included every possible path; multiplying the matrices out in full is a more mechanical process which avoids this source of error.
 
q&a part5-revision-q5.5 ii

how can we get (P^6)1,5 without calculating P^3 *P^3?

the solution is just 1 line of calculations but I would have a hard time on the exam to follow this way...
 
Right.

Am understanding this much better now. I think the answer to the original question, for anyone interested, was:

1) practice
2) the M+ function on the calculator seems to me to make summing the various multiplications a smoother process in general

Sorry if that's stating the obvious for some - matrices all new here!

(btw, on the subject of useful calculator techniques, I assume everyone has checked out the stats functions for use for CT3 and CT4? Again, I might easily have missed this, but I'm glad I found it - speeds up variances etc)

Viki - having got a bit more comfortable with the basic process now, I can't quite see why getting (P^6)1,5 by using P^3 * P^3 is any more onerous than what went before. Are you wondering if there's a shortcut?
 
yes, becasue the solution just shows one line and I was computing full matrix P^3 in order to get P^6 (1,5).



Right.

Am understanding this much better now. I think the answer to the original question, for anyone interested, was:

1) practice
2) the M+ function on the calculator seems to me to make summing the various multiplications a smoother process in general

Sorry if that's stating the obvious for some - matrices all new here!

(btw, on the subject of useful calculator techniques, I assume everyone has checked out the stats functions for use for CT3 and CT4? Again, I might easily have missed this, but I'm glad I found it - speeds up variances etc)

Viki - having got a bit more comfortable with the basic process now, I can't quite see why getting (P^6)1,5 by using P^3 * P^3 is any more onerous than what went before. Are you wondering if there's a shortcut?
 
1) You can calculate P^6 and read out the relevant entry. Try to be clever how you do this, eg if you only need the top right of P^6 then only calculate the top row and last column of P^3.
2) You could apply P six times to the row vector (1,0,0) or you could apply P^2 three times to the row vector
3) You could co it from scratch thinking about all the possible paths. This is really all the above methods are doing anyway. I totally agree with Calum above that this is dangerous because you might miss one of the possible paths

John
 
Back
Top