🔺 What is Pascal’s Triangle?
Pascal’s Triangle is a famous triangular array of numbers where each number is the sum of the two numbers directly above it. It’s named after the French mathematician Blaise Pascal, but its origins span across many ancient civilizations, including in Persia, India, and China.
🧱 How It’s Built
- The triangle starts with a single 1 at the top.
- Each row begins and ends with 1.
- Every number in between is the sum of the two numbers directly above it from the previous row.
📐 The First Few Rows
sql
1 ← Row 0
1 1 ← Row 1
1 2 1 ← Row 2
1 3 3 1 ← Row 3
1 4 6 4 1 ← Row 4
1 5 10 10 5 1 ← Row 5
Each row is symmetric and grows by one number per row.
🧮 Real-World Applications
Pascal’s Triangle isn’t just pretty — it’s powerful.
✅ 1. Binomial Expansion
The numbers in the nth row represent the coefficients in the expansion of (a+b)n(a + b)^n(a+b)n.
- Example: (a+b)2=a2+2ab+b2(a + b)^2 = a^2 + 2ab + b^2(a+b)2=a2+2ab+b2 → Coefficients: 1, 2, 1 (Row 2)
✅ 2. Combinations (n Choose k)
Each entry corresponds to the binomial coefficient:
- (nk)=n!k!(n−k)!\binom{n}{k} = \frac{n!}{k!(n-k)!}(kn)=k!(n−k)!n!Example: The 3rd number in Row 5 is:
- (52)=10\binom{5}{2} = 10(25)=10
This is the number of ways to choose 2 items from 5.
✅ 3. Symmetry
Pascal’s Triangle is symmetric:
(nk)=(nn−k)\binom{n}{k} = \binom{n}{n-k}(kn)=(n−kn)So values mirror across the center of each row.
✅ 4. Sum of Row
The sum of all numbers in the nth row is:
- 2n2^n2nRow 3: 1+3+3+1=8=231 + 3 + 3 + 1 = 8 = 2^31+3+3+1=8=23
✅ 5. Hockey Stick Pattern
Start at any "1" and move diagonally downward. The sum of that diagonal equals the number directly below and to the right of the last number in the path.
Example:
java
1
1 1
1 2 1
↑ ↑ ↑
Sum: 1 + 2 + 3 = 6 → found below = 6
📊 Where It’s Used
- Probability
- Algebra
- Combinatorics
- Computer Science (e.g., recursion problems, dynamic programming)
- Fractals and Number Patterns
🚀 Summary
Pascal’s Triangle is more than a cool math trick — it’s a deep and elegant structure that reveals patterns in binomial expansions, combinatorics, and number theory. Whether you're solving algebra problems or analyzing algorithms, it's a tool worth knowing.