Recall warm-up
- 8-bit 1's-complement sum of 200 and 100 (decimal answer)?
Stuck? Peek at 0.2.3 XOR, 1's complement addition and modulo-2 division
- AND (mask), OR, NOT (flip), XOR (1 where bits differ).
- a ⊕ a = 0, a ⊕ 0 = a, (a ⊕ k) ⊕ k = a.
- 1's complement = flip all bits; 1's-complement addition wraps the end carry back in.
- Modulo-2: + = − = XOR, no carries; bits ↔ polynomial.
- Mod-2 division: leading 1 → XOR divisor; leading 0 → XOR zeros; remainder = (divisor length − 1) bits.
- Time to push 1 KB out at 1 kbps (default units)?
Stuck? Peek at 0.2.1 Bits, bytes and prefixes: powers of 10 for rates, powers of 2 for sizes
- 1 B = 8 b. Lower-case b = bit, upper-case B = byte.
- Rates: k = 10³, M = 10⁶, G = 10⁹ (bps).
- Sizes: K = 2¹⁰, M = 2²⁰, G = 2³⁰ (bytes) — unless the question says 1000.
- Time to push out = (size in bits) ÷ (rate in bit/s).
- ms = 10⁻³ s, µs = 10⁻⁶ s, ns = 10⁻⁹ s.
- What happens on a broadcast link when two nodes send at once?
Stuck? Peek at 0.1.2 Nodes, links, topologies, LAN/WAN and the boxes in the middle
- Node = any device; host = node where messages start/end.
- Point-to-point (2 nodes) vs broadcast (all hear all).
- Simplex (one way) · half-duplex (two ways, one at a time) · full-duplex (both at once).
- Links: mesh n(n−1)/2, star n, ring n, tree n−1, bus 1 backbone.
- LAN (building) ⊂ WAN (cities) ⊂ the Internet (network of networks).
- Hub repeats to all · switch delivers within a LAN · router picks the next network.
The Hook
Picture a classroom where any student may speak whenever they like. Each one, independently, speaks in a given second with some small chance. The teacher hears something useful only if exactly one student speaks. How likely is that? Shared links in Phase 2 are exactly this classroom, and their best-case efficiency turns out to be a number involving e. Today we build the math.
Predict First
10 students each speak in a given second with probability 0.1, independently. Guess the chance that exactly one speaks: about 10 %, about 39 %, or about 90 %?
,About 39 % (0.387). Any one particular student speaks while the other nine stay quiet with probability 0.1 × 0.9⁹; there are 10 choices of who that student is, so 10 × 0.1 × 0.9⁹ ≈ 0.387. As the class grows (with probability 1/n each) this tends to 1/e ≈ 0.368.
Core Concept
Exponent rules
- 2ᵃ × 2ᵇ = 2ᵃ⁺ᵇ; 2ᵃ / 2ᵇ = 2ᵃ⁻ᵇ; (2ᵃ)ᵇ = 2ᵃᵇ; 2⁰ = 1; 2⁻ᵃ = 1/2ᵃ.
- Useful: 2¹⁰ ≈ 10³, so 2²⁰ ≈ 10⁶ and 2³⁰ ≈ 10⁹ (for estimates only).
| Expression | Value |
|---|---|
| 2⁴ × 2⁶ | 2¹⁰ = 1024 |
| 2²⁰ / 2⁸ | 2¹² = 4096 |
| (2³)⁴ | 2¹² = 4096 |
| 2⁻³ | 1/8 = 0.125 |
Logarithm base 2
log₂ answers "how many bits?" and "how many doublings?". When x is not a power of 2 we round: ⌈x⌉ (ceiling) rounds up, ⌊x⌋ (floor) rounds down. Bits needed for N values = ⌈log₂ N⌉. Rules: log₂(ab) = log₂ a + log₂ b; log₂(aᵏ) = k log₂ a.
| x | log₂ x | ⌈ ⌉ | ⌊ ⌋ |
|---|---|---|---|
| 8 | 3 | 3 | 3 |
| 1000 | 9.97 | 10 | 9 |
| 5001 | 12.29 | 13 | 12 |
| 65536 | 16 | 16 | 16 |
Probability basics
- A probability is a number from 0 (never) to 1 (always).
- Complement: P(not A) = 1 − P(A).
- Independent events (one does not affect the other): P(A and B) = P(A) × P(B).
- Mutually exclusive cases add: P(A or B) = P(A) + P(B) when they cannot both happen.
n independent senders
n stations, each sends in a slot with probability p, independently:
- P(none sends) = (1 − p)ⁿ
- P(at least one) = 1 − (1 − p)ⁿ
- P(exactly one) = n · p · (1 − p)ⁿ⁻¹ (n choices of who, that one sends, the other n − 1 stay quiet)
The number e and the 1/e limit
e ≈ 2.71828. Two facts matter for networks:
- (1 − 1/n)ⁿ → 1/e ≈ 0.368 as n grows. (n = 10: 0.349; n = 100: 0.366.)
- The best chance of "exactly one of n" is when p = 1/n, and it also tends to 1/e. Phase 2 meets two numbers built from e as best-case efficiencies of random sharing: 1/e ≈ 0.368 and 1/(2e) ≈ 0.184.
Geometric series and expected value
- 1 + 2 + 4 + … + 2ᵏ⁻¹ = 2ᵏ − 1.
- 1 + r + r² + … + rⁿ⁻¹ = (1 − rⁿ)/(1 − r); for 0 ≤ r < 1 the infinite sum is 1/(1 − r).
- Expected value = Σ (value × probability). If each try succeeds with probability p, the expected number of tries until the first success is 1/p.
| p (success per try) | expected tries 1/p |
|---|---|
| 0.5 | 2 |
| 0.25 | 4 |
| 0.1 | 10 |
Putting it together
- log₂ counts bits and doublings; round up with ⌈ ⌉ for "how many bits".
- For n independent senders: none (1−p)ⁿ, exactly one n·p·(1−p)ⁿ⁻¹, at least one 1 − (1−p)ⁿ.
- e appears as the limit 1/e ≈ 0.368 — the ceiling on random sharing efficiency in Phase 2.
Visual
Worked Examples
Find log₂ 1000, ⌈log₂ 1000⌉ and ⌊log₂ 1000⌋.
Show the full solution
2⁹ = 512 and 2¹⁰ = 1024, so log₂ 1000 ≈ 9.97. Ceiling = 10, floor = 9.
5 stations each send in a slot with probability 0.2, independently. Find P(none), P(exactly one), P(at least one).
Show the full solution
P(none) = 0.8⁵ = 0.32768. P(exactly one) = 5 × 0.2 × 0.8⁴ = 5 × 0.2 × 0.4096 = 0.4096. P(at least one) = 1 − 0.32768 = 0.67232.
n = 10 stations each send with probability p = 1/n. What is the probability that exactly one sends (4 decimals)? Compare with 1/e.
Show the full solution
10 × 0.1 × 0.9⁹ = 0.9⁹ = 0.3874. 1/e ≈ 0.3679. The value is a little above 1/e and approaches it as n grows.
GATE Traps
- "At least one" is 1 − P(none), not n·p (n·p can exceed 1).
- Exactly one of n needs the factor n — any of the n stations can be the lucky one.
- ⌈log₂ N⌉ gives the bits for N values; 0..N is N + 1 values.
Memory Hook
"One talks, the rest are quiet, any one of n": n · p · (1 − p)ⁿ⁻¹.
Connect the Dots
Phase 0's toolkit is complete: units (0.2.1), binary and hex (0.2.2), bit operations (0.2.3), logs and probability (0.2.4). Next (Phase 1): sending one message involves many separate jobs — encoding, addressing, choosing paths, checking. How do engineers split such a big job so that each part can be built and changed independently?
Self-Test
- NAT
⌈log₂ 3000⌉ = ?
Write your answer before opening the key.
- NAT
4 stations each send with probability 0.25. P(exactly one sends)? (4 decimals)
Write your answer before opening the key.
- MCQ
As n grows, (1 − 1/n)ⁿ approaches:
- 0
- 1/e ≈ 0.368
- 1/2
- e ≈ 2.718
- MSQ
For n independent stations with probability p each, which are correct?
- P(none) = (1 − p)ⁿ
- P(at least one) = n·p
- P(exactly one) = n·p·(1 − p)ⁿ⁻¹
- P(at least one) = 1 − (1 − p)ⁿ
- NAT
Each attempt succeeds with probability 0.2. Expected number of attempts until the first success?
Write your answer before opening the key.
Rule Card
- 2ᵃ·2ᵇ = 2ᵃ⁺ᵇ; 2¹⁰ ≈ 10³ (estimates only).
- log₂ x = power of 2 giving x; bits for N values = ⌈log₂ N⌉.
- P(none) = (1−p)ⁿ · P(≥ 1) = 1 − (1−p)ⁿ · P(exactly 1) = n·p·(1−p)ⁿ⁻¹.
- (1 − 1/n)ⁿ → 1/e ≈ 0.368; 1/(2e) ≈ 0.184.
- 1 + 2 + … + 2ᵏ⁻¹ = 2ᵏ − 1; expected tries = 1/p.
Concept Ledger
- exponent rules
- log₂
- ceiling ⌈ ⌉ / floor ⌊ ⌋
- probability, complement
- independent events
- (1 − p)ⁿ, n·p·(1 − p)ⁿ⁻¹
- e, 1/e limit
- geometric series
- expected value, 1/p
Answer Vault
Try the questions first. Open when you are ready to check.
Warm-up answers
- 300 ≥ 256 → 300 − 256 + 1 = 45.
- 8192 / 1000 = 8.192 s.
- Their signals mix and both are spoiled.
Self-test answers
- 12 — 2¹¹ = 2048 < 3000 ≤ 4096 = 2¹² → 12.
- 0.421..0.422 — 4 × 0.25 × 0.75³ = 0.421875.
- B — A standard limit: (1 − 1/n)ⁿ → e⁻¹.
- A: It stays near 0.37, never reaching 0.
- C: n = 2 gives 0.25, n = 10 gives 0.349 — it settles at 0.368, not 0.5.
- D: (1 + 1/n)ⁿ → e; with the minus sign the limit is 1/e.
- ACD — Complement and independence give A, C, D.
- B: n·p double-counts overlaps and can exceed 1.
- 5 — Expected tries = 1/p = 5.
Flashcards
- P(exactly one of n sends)?
Reveal answer
n·p·(1 − p)ⁿ⁻¹. - (1 − 1/n)ⁿ for large n?
Reveal answer
≈ 1/e ≈ 0.368. - 1 + 2 + 4 + … + 2ᵏ⁻¹?
Reveal answer
2ᵏ − 1. - Expected tries with success probability p?
Reveal answer
1/p. - Bits for N values?
Reveal answer
⌈log₂ N⌉.
Exam shortcuts
- Exactly one of n = n·p·(1−p)ⁿ⁻¹; maximised at p = 1/n; → 1/e for large n. — n identical, independent senders, each with the same p.
- 1/e ≈ 0.368, 1/(2e) ≈ 0.184. — whenever a maximum efficiency of a random sharing scheme is asked (Phase 2).