Every shop you visit gives you exactly 2 choices: Buy or Skip. You want to try every possible combination of decisions.
3 shops → 8 possible combinations:
Buy-Buy-Buy, Buy-Buy-Skip,
Buy-Skip-Buy, Buy-Skip-Skip,
Skip-Buy-Buy, Skip-Buy-Skip,
Skip-Skip-Buy, Skip-Skip-Skip
Each new shop doubles the total number of combinations.
Like a WhatsApp forward: you send to 2 friends, each sends to 2 more... after 30 forwards, over 1 BILLION messages!
🚨
20 shops → 1,048,576 combinations.
30 shops → over 1 billion. Only practical when n is very small (n ≤ 20).
💥 Big O = O(2ⁿ)
Buy or Skip — combinations explode!
↙ Buy Skip ↘
↙↘ ↙↘
B+Buy2
B+Skip2
S+Buy2
S+Skip2
↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
BBB
BBS
BSB
BSS
SBB
SBS
SSB
SSS
3 shops = 2³ = 8 combinations
n = 10
1,024
combinations
Real examples: Naive Fibonacci, finding all subsets