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

# Pepsi user buying Coke, third purchase

Simulation and Modeling · Chapter 5: Markov chains

- Asked in: 2072 Magh, 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-pepsi-coke-third
- Whole chapter: https://www.bctengineer.com/md/semester_8/simulation_and_modeling/chapter-5

## Question

What is Markov chain? Find the transition probability of a Pepsi user who will buy Coke on third purchase. Transition probability is as below:

|  | Pepsi | Coke |
|---|---|---|
| Pepsi | 0.7 | 0.3 |
| Coke | 0.1 | 0.9 |

## Short answer

A Markov chain is a random process where the next state depends only on the current state. With the given transition matrix, the probability that a Pepsi user buys Coke on the third purchase, found from P^3, is 0.588 (58.8%).

## Answer

#### Markov chain

A **Markov chain** is a random process with a finite number of states in which the probability of moving to the next state depends only on the current state, not on earlier history. The probabilities are stored in a transition matrix whose rows sum to 1. Here the states are Pepsi and Coke (brand of the soft drink bought).

#### Numerical

**Assumption**: "third purchase" means three transitions, so we need p(Pepsi to Coke) in P^3.

P = [[0.7, 0.3], [0.1, 0.9]] (order: Pepsi, Coke)

**Method 1: matrix power**

P^2: Pepsi row = [0.7 x 0.7 + 0.3 x 0.1, 0.7 x 0.3 + 0.3 x 0.9] = [0.52, 0.48]; Coke row = [0.1 x 0.7 + 0.9 x 0.1, 0.1 x 0.3 + 0.9 x 0.9] = [0.16, 0.84]

P^3 = P^2 x P, Pepsi row:

- To Pepsi: 0.52 x 0.7 + 0.48 x 0.1 = 0.364 + 0.048 = 0.412
- To Coke: 0.52 x 0.3 + 0.48 x 0.9 = 0.156 + 0.432 = **0.588**

**Method 2: add all three-step paths from Pepsi to Coke**

| Path | Probability |
|---|---|
| P - P - P - C | 0.7 x 0.7 x 0.3 = 0.147 |
| P - P - C - C | 0.7 x 0.3 x 0.9 = 0.189 |
| P - C - P - C | 0.3 x 0.1 x 0.3 = 0.009 |
| P - C - C - C | 0.3 x 0.9 x 0.9 = 0.243 |
| Total | 0.588 |

Both methods agree. **Answer**: a Pepsi user will buy Coke on the third purchase with probability **0.588 (58.8%)**.

## Check yourself

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

1. What does the Markov chain assume about the next state?
   A. It depends only on the current state
   B. It depends on the last three states
   C. It is independent of the current state
   D. It depends on the first state only
   Answer: A. Memoryless property. (Key point: Markov chain)

2. What is needed for a Pepsi user buying Coke on the third purchase?
   A. Pepsi-to-Coke entry of P
   B. Pepsi-to-Coke entry of P^3
   C. Pepsi-to-Pepsi entry of P^3
   D. Coke-to-Pepsi entry of P^2
   Answer: B. Third purchase means three transitions. (Key point: Interpretation)

3. How does the path method work?
   A. Multiply the probabilities of all paths
   B. Use only the most likely path
   C. Add the probabilities of all three-step paths from Pepsi to Coke
   D. Average the paths
   Answer: C. There are four paths and their probabilities total 0.588. (Key point: Method 2)

4. What is the probability?
   A. 0.412
   B. 0.480
   C. 0.900
   D. 0.588
   Answer: D. Pepsi row of P^3 is [0.412, 0.588]. (Key point: 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
- [Coke-Pepsi Markov diagram, 3rd purchase](https://www.bctengineer.com/question.md?key=semester_8%2Fsimulation_and_modeling%3Amarkov-coke-pepsi-diagram) — Simulation and Modeling, chapter 5
- [Honda-Yamaha Markov, key features](https://www.bctengineer.com/question.md?key=semester_8%2Fsimulation_and_modeling%3Amarkov-honda-yamaha) — Simulation and Modeling, chapter 5
- [Markov applications; Sony-Samsung 75/85](https://www.bctengineer.com/question.md?key=semester_8%2Fsimulation_and_modeling%3Amarkov-sony-samsung-75-85) — Simulation and Modeling, chapter 5, asked 2×
- [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×
- [Markov chain with features and applications](https://www.bctengineer.com/question.md?key=semester_8%2Fsimulation_and_modeling%3Amarkov-chain-explain-applications) — Simulation and Modeling, chapter 5, asked 3×
