Find the probability of using coke for a current pepsi user in 4th purchase?Markov Model problem.

shivajikobardan

Junior Member
Joined
Nov 1, 2021
Messages
107
Design the markov model and transition matrix for the given data. Answer the following questions based on the mode.
a) If a person purchase coke now the probability of purchase of coke next time is 80%.
b) If a person purchases pepsi now the probability of purchasing pepsi next time is 70%.

Then,
Find the probability of using coke for a current pepsi user in 4th purchases-:

My solution-:
4MgnCm3QHosELoWQk-S1rxJ1OjnuObR7yn80p1-UBH4TtJsvKVne-265fdK5QRGJmJ58hxTWn0zalcqpW3P43Bpew9jlbwF11IKw-HDr4aemdDutK2uLMben_diGd5Af3mY-bqgJ0Wen7o3eKGIJ9bA

This is the transition diagram.

This is the transition probability matrix-:

26uw6G8iVZc4LPzBfp9Nq3aQq6j79F0QrJ8nPXHQrx2MRflA58zalCsQcxk8mnOWkUqWmP4j3Q_FNYGBtxwADr2eZsM0jUHTNZVpkHg4Y44SaMj888ccO-GRMvvQ0X-WotF14kKK8fa4T29CqNQ

So, what I did was basically to Took this TPM(Transition Probability Matrix) to the power 4. My basis for doing this was this source-: https://www.math.pku.edu.cn/teachers/xirb/Courses/biostatistics/Biostatistics2016/Lecture4.pdf

So what I got was-:

3ez2gYlZOB1cji7ALC8QN5flVTZXih24-aGt1m4nIIpx2cM8hGoDvr3ZuD4AyJUQkJJIG7EBB-177CcorBfJXB9Qsniv92JvGHD0K2tDXdjLDJBMOrIea2wHw7iELOLlseZTVZ1_k0qxmkEdao2YGrE

Now I am assuming that the rows means FROM and column side means TO. And the first element of row and column is "Coke". So, to find from Pepsi to Coke, I'd go to second row and first column, the value would be 0.5625

But the problem is that, I've conflicting source which claims the answer is sth else-:

It solves it like this-:

P=TPM

p=Current distribution=[0 1]

Now, for 2nd purchase

p²=p*P=[0.3 0.7]

For 3rd purchase-:
p³=p² * P
=[0.45 0.55]

For 4th purchase-:
VlMGXGT6dOGvTEHnelsVuW9Nr1NrPliK5WmhtPSzC86I9zOcj_Z70RzScMByMvnVdcS84flQAgfRLN1pFjpfisz62U06H4VZ_A9dwtswIXQQEelk8n02t87poHNOywHSbQ4dMAhJoggsd3cGMcs


=[0.525 0.475]

Thus, it concludes that the required answer is 0.525.

Which one is correct in your opinion?
 
Design the markov model and transition matrix for the given data. Answer the following questions based on the mode.
a) If a person purchase coke now the probability of purchase of coke next time is 80%.
b) If a person purchases pepsi now the probability of purchasing pepsi next time is 70%.

Then,
Find the probability of using coke for a current pepsi user in 4th purchases-:

My solution-:
4MgnCm3QHosELoWQk-S1rxJ1OjnuObR7yn80p1-UBH4TtJsvKVne-265fdK5QRGJmJ58hxTWn0zalcqpW3P43Bpew9jlbwF11IKw-HDr4aemdDutK2uLMben_diGd5Af3mY-bqgJ0Wen7o3eKGIJ9bA

This is the transition diagram.

This is the transition probability matrix-:

26uw6G8iVZc4LPzBfp9Nq3aQq6j79F0QrJ8nPXHQrx2MRflA58zalCsQcxk8mnOWkUqWmP4j3Q_FNYGBtxwADr2eZsM0jUHTNZVpkHg4Y44SaMj888ccO-GRMvvQ0X-WotF14kKK8fa4T29CqNQ

So, what I did was basically to Took this TPM(Transition Probability Matrix) to the power 4. My basis for doing this was this source-: https://www.math.pku.edu.cn/teachers/xirb/Courses/biostatistics/Biostatistics2016/Lecture4.pdf

So what I got was-:

3ez2gYlZOB1cji7ALC8QN5flVTZXih24-aGt1m4nIIpx2cM8hGoDvr3ZuD4AyJUQkJJIG7EBB-177CcorBfJXB9Qsniv92JvGHD0K2tDXdjLDJBMOrIea2wHw7iELOLlseZTVZ1_k0qxmkEdao2YGrE

Now I am assuming that the rows means FROM and column side means TO. And the first element of row and column is "Coke". So, to find from Pepsi to Coke, I'd go to second row and first column, the value would be 0.5625

But the problem is that, I've conflicting source which claims the answer is sth else-:

It solves it like this-:

P=TPM

p=Current distribution=[0 1]

Now, for 2nd purchase

p²=p*P=[0.3 0.7]

For 3rd purchase-:
p³=p² * P
=[0.45 0.55]

For 4th purchase-:
VlMGXGT6dOGvTEHnelsVuW9Nr1NrPliK5WmhtPSzC86I9zOcj_Z70RzScMByMvnVdcS84flQAgfRLN1pFjpfisz62U06H4VZ_A9dwtswIXQQEelk8n02t87poHNOywHSbQ4dMAhJoggsd3cGMcs


=[0.525 0.475]

Thus, it concludes that the required answer is 0.525.

Which one is correct in your opinion?
Your idea is correct, but you only need to raise your TPM to the 3rd. The TPM itself is already 1 transition (hence the name transition matrix), and you need 3 more transitions.
[math]\begin{bmatrix} .8 & .2\\ .3 & .7 \end{bmatrix}^3= \begin{bmatrix} .65 & .35\\ \red{.525} & .475 \end{bmatrix}[/math]
 
Your idea is correct, but you only need to raise your TPM to the 3rd. The TPM itself is already 1 transition (hence the name transition matrix), and you need 3 more transitions.
[math]\begin{bmatrix} .8 & .2\\ .3 & .7 \end{bmatrix}^3= \begin{bmatrix} .65 & .35\\ \red{.525} & .475 \end{bmatrix}[/math]
But this source doesn't say so-:
1659007675019.png
1659007702188.png
Can you recommend me any books that have solved examples like this(reputed books). I've tons of unreputed sources written by our unknown seniors.
 
The problem here is linguistic.

We know nothing about what someone will do initially. You can apply the transition matrix only to go from one state to another.

If we interpret ”current pepsi user” as meaning the most recent past purchase was a pepsi, and the question involves the fourth future purchase, then raise the transition matrix to the fourth power.

If we interpret “current pepsi user“ as meaning that it is given that the next purchase is pepsi and the question involves the third purchase after that, then raise the transition matrix to the third power.

These are questions of linguistic interpretation, not of math.

In your first problem, I read that one as meaning the last purchase was pepsi, and they want you to go four steps into the future.

Your alternative source, however, reads it differently and assumes that purchase 1 is given to be pepsi and raises the transition matrix to the third power.

I think your initial reading and my reading are better, but I am not sure the alternative reading is completely wrong.

To put it a different way, we start with the [0, 1] matrix and multiply that initial matrix by the transition matrix to the number of steps past the initial matrix we are to go.
 
The problem here is linguistic.

We know nothing about what someone will do initially. You can apply the transition matrix only to go from one state to another.

If we interpret ”current pepsi user” as meaning the most recent past purchase was a pepsi, and the question involves the fourth future purchase, then raise the transition matrix to the fourth power.

If we interpret “current pepsi user“ as meaning that it is given that the next purchase is pepsi and the question involves the third purchase after that, then raise the transition matrix to the third power.

These are questions of linguistic interpretation, not of math.

In your first problem, I read that one as meaning the last purchase was pepsi, and they want you to go four steps into the future.

Your alternative source, however, reads it differently and assumes that purchase 1 is given to be pepsi and raises the transition matrix to the third power.

I think your initial reading and my reading are better, but I am not sure the alternative reading is completely wrong.

To put it a different way, we start with the [0, 1] matrix and multiply that initial matrix by the transition matrix to the number of steps past the initial matrix we are to go.
yeah but these are standard textbooks problems. so there should a fixed answer. I think first interpretation is correct according to the 1 source I found. These are only found in indian authored textbooks of math etc. But IDK if I can find their name. Western writers prefer to write detailed theory rather than examples.
 
But this source doesn't say so-:
View attachment 33513
View attachment 33514
Can you recommend me any books that have solved examples like this(reputed books). I've tons of unreputed sources written by our unknown seniors.
As JeffM said, it's about linguistics. The second question is phrased differently than the first.
Let's count how many cans of soda and the number of transitions.
If you have a can of Coke to start with, and you purchase two more, then you have 3 cans total. This means that there are going to be 2 transitions. Thus you raise to the power of 2.

Similarly, back to the OP. If you have 1 can of soda to start with, and you're to figure about the 4th one. Meaning you'd have 4 cans of soda i.e. 3 transitions. Thus you raise to the 3rd.

EDIT: Here's the book (PDF link) I used. Chapter 3 is the intro to Markov Chain.
 
Last edited:
yeah but these are standard textbooks problems. so there should a fixed answer. I think first interpretation is correct according to the 1 source I found. These are only found in indian authored textbooks of math etc. But IDK if I can find their name. Western writers prefer to write detailed theory rather than examples.
I also post at English Language Learners Stack Exchange and have learned not to comment on Indian English.

Obviously, I agree with BBB that, if we know the state of can 1, then we use the transition matrix three times for can 4. The question comes down to where do we start counting when the problem says “current user.” It is an inherently ambiguous term. The problems could eliminate the ambiguity by saying “most recently purchased was X” and asking for the probability of X after n additional purchases.
 
Top