---
title: "Coke-Pepsi Markov diagram, 3rd purchase"
subject: "Simulation and Modeling"
chapter: 5
key: "semester_8/simulation_and_modeling:markov-coke-pepsi-diagram"
source: https://www.bctengineer.com/q/semester_8/simulation_and_modeling/markov-coke-pepsi-diagram
site: BCT Engineering
---

# Coke-Pepsi Markov diagram, 3rd purchase

Simulation and Modeling · Chapter 5: Markov chains

- Asked in: 2071 Bhadra, 6 marks
- Video: [Markov Chains Clearly Explained! Part - 1](https://www.youtube.com/watch?v=i3AkTO9HLXo) — Normalized Nerd
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_8/simulation_and_modeling/markov-coke-pepsi-diagram
- Whole chapter: https://www.bctengineer.com/md/semester_8/simulation_and_modeling/chapter-5

## Question

Given figure shows Coke and Pepsi purchaser (state diagram: Coke to Coke 70%, Coke to Pepsi 30%, Pepsi to Pepsi 80%, Pepsi to Coke 20%).
a) If currently Coke purchaser, what is the probability of Pepsi purchaser in 3rd purchase?
b) If 55% of people use Coke today, what percentage of people will use Coke after 3 purchases?

## Short answer

Using the transition matrix P and computing P^3, a current Coke purchaser becomes a Pepsi purchaser on the third purchase with probability 0.525. If 55% use Coke today, after three purchases about 41.9% use Coke, from p(0) times P^3.

## Answer

From the diagram the transition matrix is (states Coke, Pepsi):

P = [[0.7, 0.3], [0.2, 0.8]]

**Assumption**: "3rd purchase" means three transitions, so P^3 is used.

**P squared**

- Coke row: 0.7 x 0.7 + 0.3 x 0.2 = 0.55; 0.7 x 0.3 + 0.3 x 0.8 = 0.45
- Pepsi row: 0.2 x 0.7 + 0.8 x 0.2 = 0.30; 0.2 x 0.3 + 0.8 x 0.8 = 0.70

**P cubed = P^2 x P**

- Coke row: [0.55 x 0.7 + 0.45 x 0.2, 0.55 x 0.3 + 0.45 x 0.8] = [0.475, 0.525]
- Pepsi row: [0.30 x 0.7 + 0.70 x 0.2, 0.30 x 0.3 + 0.70 x 0.8] = [0.350, 0.650]

P^3 = [[0.475, 0.525], [0.350, 0.650]]

#### (a) Coke user now, Pepsi in the 3rd purchase

p(Coke to Pepsi) in P^3 = **0.525**

#### (b) 55% use Coke today

p(0) = [0.55, 0.45]; p(3) = p(0) P^3.

- Coke: 0.55 x 0.475 + 0.45 x 0.35 = 0.26125 + 0.1575 = 0.41875
- Pepsi: 0.55 x 0.525 + 0.45 x 0.65 = 0.28875 + 0.2925 = 0.58125

After three purchases about **41.9%** of people use Coke (and 58.1% use Pepsi).

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What is P with rows Coke, Pepsi?
   A. [[0.7, 0.3], [0.2, 0.8]]
   B. [[0.7, 0.2], [0.3, 0.8]]
   C. [[0.3, 0.7], [0.8, 0.2]]
   D. [[0.7, 0.3], [0.8, 0.2]]
   Answer: A. Coke to Coke 0.7, Coke to Pepsi 0.3, Pepsi to Pepsi 0.8, Pepsi to Coke 0.2. (Key point: Matrix from diagram)

2. Coke user now: probability of Pepsi in the 3rd purchase?
   A. 0.475
   B. 0.525
   C. 0.350
   D. 0.650
   Answer: B. Coke-to-Pepsi in P^3 = 0.55x0.3 + 0.45x0.8 = 0.525. (Key point: Part a)

3. 55% use Coke today. How is the distribution after 3 purchases found?
   A. p(3) = P^3 [0.55, 0.45]
   B. p(3) = [0.55, 0.45] P
   C. p(3) = [0.55, 0.45] P^3
   D. p(3) = 0.55 P^3 only
   Answer: C. Initial vector times P^3. (Key point: Part b setup)

4. What percentage uses Coke after 3 purchases?
   A. About 47.5%
   B. About 58.1%
   C. About 55%
   D. About 41.9%
   Answer: D. 0.55x0.475 + 0.45x0.35 = 0.41875; Pepsi is 58.1%. (Key point: Part b result)

## Related in Simulation and Modeling

- [Coke-Pepsi Markov model, 4th purchase](https://www.bctengineer.com/question.md?key=semester_8%2Fsimulation_and_modeling%3Amarkov-coke-pepsi-4th-purchase) — Simulation and Modeling, chapter 5
- [Pepsi user buying Coke, third purchase](https://www.bctengineer.com/question.md?key=semester_8%2Fsimulation_and_modeling%3Amarkov-pepsi-coke-third) — Simulation and Modeling, chapter 5
- [Nokia-Samsung Markov, two purchases](https://www.bctengineer.com/question.md?key=semester_8%2Fsimulation_and_modeling%3Amarkov-nokia-samsung) — Simulation and Modeling, chapter 5, asked 2×
- [Sony-Samsung Markov, 80/85, 60% users](https://www.bctengineer.com/question.md?key=semester_8%2Fsimulation_and_modeling%3Amarkov-sony-samsung-80-85) — Simulation and Modeling, chapter 5
