CS6015: Linear Algebra and Random Processes
Lecture 23: Counting Principles : Very Simple Counting, Multiplication Principle
Learning Objectives
Why do we need to learn Counting Principles?
What is the multiplication principle?
Why do we need "Counting"?
Why do we need Probability Theory?
What is the probability that a statistic computed from a sample is close to that computed from a population?
Population
Sample
Statistics (from sample)
- mean sugar level
- mean no. of runs
- mean agri. yield
- variance in fertility rate
Compute using Probability Theory
Why do we need Probability Theory?
Machine Learning
P(label = cat | image) ?
predict a distribution over classes
cat? dog? owl? lion?
cat dog lion
0.7
0.2
0.1
Why do we need Counting?
What is the probability of getting a heads?
\frac{1}{2}~or~50\%
How did you compute this?
2 possible outcomes: each equally likely
Why do we need Counting?
What is the probability of getting a 6?
\frac{1}{6}~or~16.67\%
How did you compute this?
6 possible outcomes: each equally likely
Why do we need Counting?
What is the probability of getting 4 aces?
\frac{1}{n}
But what is
n is the number of possible outcomes, i.e., all possible combinations of 4 cards
n ?
\cdots
How do you count
n ?
(using principles of counting)
Why do we need Counting?
Without knowing how to count the number of outcomes we will not be able to compute the probbaility
\cdots
Turns out that there are 270725 ways of selecting 4 cards from 52 cards! (0.00036% chance of getting 4 aces)
Objective of the chapter
Learn how to count the number of outcomes of an experiment
\cdots
Very Simple Counting
Counting: a simple example
How many numbers are there between 73 and 358? (both inclusive)
Easy!
How many numbers are there between 73 and 358 which are divisible by 7 ? (both inclusive)
Hmm, a little hard!
Let's dumb it down even further and start from the absolute basics!
Counting: the simplest example
How many numbers are there between 1 and 358? (both inclusive)
Super Easy! 358
The number of numbers between 1 and n is n (yup, it doesn't get simpler than this)
Counting: a simple example
How many numbers are there between 73 and 358? (both inclusive)
73, 74, 75, ...., ...., ...., 356, 357, 358
We know how to count from 1 to n (can we use that principle here?)
-72
1, 2, 3, ...., ...., ...., 284, 285, 286
Counting: a simple example
How many numbers are there between 73 and 358? (both inclusive)
73, 74, 75, ...., ...., ...., 356, 357, 358
358 - 72 = 358 - (73 - 1) = 358 - 73 + 1 = 286
The number of numbers between k and n is (n-k+1)
How many numbers are there between 73 and 358 which are divisible by 7 ?
77, 84, 91, ...., ...., ...., 343, 350, 357
We know how to count consecutive numbers from k to n (can we use that principle here?)
11, 12, 13, ...., ...., ...., 49, 50, 51
\div 7
(51 - 11 + 1 = 41 numbers)
Counting: a (not so) simple example
Counting: a (not so) simple example
How many numbers are there in this sequence ?
-21, -17, -13, ...., ...., ...., 391, 395, 399
-20, -16, -12, ...., ...., ...., 392, 396, 400
+ 1
\div 4
-5, -4, -3, ...., ...., ...., 98, 99, 100
(100 - (-5) + 1 = 106 numbers)
How many numbers are there in this sequence ?
+ 2
* 12
9\frac{5}{12}, 9\frac{5}{6}, 10\frac{1}{4}, \dots, 21\frac{1}{2}, 21\frac{11}{12}, 22\frac{1}{3}
\frac{113}{12}, \frac{118}{12}, \frac{123}{12}, \dots, \frac{258}{12}, \frac{263}{12}, \frac{268}{12}
113, 118, 123, \dots, 258, 263, 268
115, 120, 125, \dots, 260, 265, 270
\div 5
23, 24, 25, \dots, 52, 53, 54
Counting: a (not so) simple example
The multiplication principle
Can you have a different combo on every day of the month?
South
North
Beverage
Combo:
S
N
B
Then number of ways of making a sequence of independent choices is just the product of the number of choices at each step
How many ways are there of forming such a committee?
8
12
Committee:
B
G
Learning Objectives
Why do we need to learn Counting Principles?
What is the multiplication principle?
CS6015: Lecture 23
By Mitesh Khapra
CS6015: Lecture 23
Lecture 23: Counting Principles - Very Simple Counting, Multiplication Principle
- 1,737