We have 5 page frames and the reference string of length 15:
3, 8, 2, 3, 9, 1, 6, 3, 8, 9, 3, 6, 2, 1, 3
### 1. FIFO Simulation:
3: Fault →[3]
8: Fault →[3,8]
2: Fault →[3,8,2]
3: Hit →[3,8,2]
9: Fault →[3,8,2,9]
1: Fault →[3,8,2,9,1]
6: Fault (replaces 3) →[8,2,9,1,6]
3: Fault (replaces 8) →[2,9,1,6,3]
8: Fault (replaces 2) →[9,1,6,3,8]
9: Hit →[9,1,6,3,8]
3: Hit →[9,1,6,3,8]
6: Hit →[9,1,6,3,8]
2: Fault (replaces 9) →[1,6,3,8,2]
1: Hit →[1,6,3,8,2]
3: Hit →[1,6,3,8,2]
Total FIFO faults = 9
---
### 2. LRU Simulation:
3: Fault →[3]
8: Fault →[3,8]
2: Fault →[3,8,2]
3: Hit →[8,2,3]
9: Fault →[8,2,3,9]
1: Fault →[8,2,3,9,1]
6: Fault (LRU is 8) →[2,3,9,1,6]
3: Hit →[2,9,1,6,3]
8: Fault (LRU is 2) →[9,1,6,3,8]
9: Hit →[1,6,3,8,9]
3: Hit →[1,6,8,9,3]
6: Hit →[1,8,9,3,6]
2: Fault (LRU is 1) →[8,9,3,6,2]
1: Fault (LRU is 8) →[9,3,6,2,1]
3: Hit →[9,6,2,1,3]
Total LRU faults = 9
Both algorithms incur 9 page faults. Therefore, Both incur the same number of page faults is true.