Recap: List of Topics

Descriptive Statistics

Probability Theory

Inferential Statistics

Different types of data

Different types of plots

Measures of centrality and spread

Counting, Sample spaces, events

Discrete and continuous RVs

Bernoulli, Uniform, Normal dist.

Sampling strategies

Interval Estimators

Hypothesis testing (z-test, t-test)

ANOVA, Chi-square test

Linear Regression

Recap: List of Topics

Descriptive Statistics

Probability Theory

Inferential Statistics

Different types of data

Different types of plots

Measures of centrality and spread

Counting, Sample spaces, events

Discrete and continuous RVs

Bernoulli, Uniform, Normal dist.

Sampling strategies

Interval Estimators

Hypothesis testing (z-test, t-test)

ANOVA, Chi-square test

Linear Regression

Learning Objectives

Why do we need to learn Counting Principles?

What are the principles of counting?

Multiplication principle

Subtraction principle

What are sequences and how do you count them?

What are collections and how do you count them?

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

The multiplication principle 

(Special Cases)

Making a sequence of k objects from given n objects with repetition

10

M         T        W       T        F        S         S

How many weekly exercise plans can you make if you can repeat the same exercise more than once?

Make a sequence of 7 items from given 10 items

The number of sequences of kkk objects made from given nnn objects when any object in the sequence can be repeated any number of times is nkn^k
 

n^k

Make a sequence of 5 items from given 26 items

a b c d e f g h i j k l m n o p q r s t u v w x y z

26

5

How many 5 letter words can you form using the alphabets of the English language?

Making a sequence of k objects from given n objects with repetition

Making a sequence of k objects from given n objects without repetition

10

M         T        W       T        F        S         S

How many weekly exercise plans can you make if you cannot repeat the same exercise more than once?

Are the number choices at each step independent? Yes

10

M         T        W       T        F        S         S

Are the choices at each step independent? No

The number of sequences of kkk objects made from given nnn objects such that no object in the sequence can be repeated is n(n−1)(n−2)...(n−k+1)n (n-1) (n-2) ... (n-k+1)n(n1)(n2)...(nk+1)

10

M         T        W       T        F        S         S

7

10 * 9 * 8 * 7 * 6 * 5 * 4
10 * (10 - 1) * (10 - 2) * (10 - 3) * (10 - 4) * (10 - 5) * (10 - 6)

3

How many 3 digit numbers are there that contain no zeros and no repeated digits?

How many of the above numbers are odd?

1 2 3 4 5 6 7 8 9

9

3

a b c d e f g h i j k l m n o p q r s t u v w x y z

26

5

How many 5 letter words can you form using the alphabets of the English language so that no letter is repeated?

5

How many of those words end with a consonant?

if the problem specifies a constraint or restriction then always start by addressing the restriction first

3

1 2 3 4 5 6 7 8 9

9

a b c d e f g h i j k l m n o p q r s t u v w x y z

26

5

Are we creating a sequence here?

Given a class of 15 students, on how many ways can you form a committee comprising of a president, vice-president, treasurer and secretary?

15

P

VP

T

S

15

P

VP

T

S

President Vice-President Treasurer Secretary
Jack Jill Johnny Mary
Jill Jack Johnny  Mary
Mary Jack Jill Johnny
Mary Jill Johnny Jack

Order Matters!

The number of ways of filling kkk named or numbered slots using a collection of nnn objects is the same as the number of ways of creating a sequence of k elements such that no object in the sequence can be repeated: n(n−1)(n−2)...(n−k+1)n (n-1) (n-2) ... (n-k+1)n(n1)(n2)...(nk+1)

Making a sequence of n objects from given n objects

1                2              3              4              5              6            7               8              9

n = k = 9

n = 9

k = 9

n(n1)(n2)...(nk+1)

9 * 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1

= 9!

Suppose you haver 9 flower pots that you arrange in a line at the entrance of your house? In how many different ways can you arranges these pots?

The number of sequences of length n that can be formed using n objects so that no object in the sequence is repeated is n!

The number of ways in which n objects can be arranged amongst themselves is n!

The number of permutations of n objects is n!

The number of sequences of kkk objects made from a collection of nnn objects such that no object in the sequence can be repeated is n(n−1)(n−2)...(n−k+1)n (n-1) (n-2) ... (n-k+1)n(n1)(n2)...(nk+1)

n*(n-1)(n-2)\dots(n-k+1)
= \frac{n!}{(n-k)!}
=\frac{n*(n-1)(n-2)\dots(n-k+1)(n-k)(n-k-1)(n-k-2)\dots3*2*1}{(n-k)(n-k-1)(n-k-2)\dots3*2*1}

n = 5+4

k = 9

In how many ways can you arrange the pots so that no two red pots are adjacent to each other?

1                2              3             4              5               1               2               3              4

The subtraction principle 

Recap

Always address the restriction first

The number of choices at each step should be independent of the choices made at previous steps

What if you can't do this?

a b c d e f g h i j k l m n o p q r s t u v w x y z

26

How many 3 letter words can you form which contain at least one vowel and no letter is repeated?

3

count(B) = count(A) - count(C)

The number of objects that satisfy some condition is equal to the total number of objects in the collection minus the ones which do not satisfy this condition

A

C

B

a b c d e f g h i j k l m n o p q r s t u v w x y z

26

3

A = set of all 3 letter words with no letter repeated

B = set of all 3 letter words with no letter repeated and at least one vowel

C = set of all 3 letter words with no letter repeated and no vowels

count(A) = 26*25*24
count(C) = 21*20*19
count(B) = 26*25*24 - 21*20*19

a b c d e f g h i j k l m n o p q r s t u v w x y z

26

How many 5 letter words can you form which contain at least two consecutive letters which are the same?

5

APPLE, SHEEP,  UTTER, ATTTA, LLLAP

BEARS, RUSTY, DODUD

a b c d e f g h i j k l m n o p q r s t u v w x y z

26

5

A = set of all 5 letter words

B = set of all 5 letter words containing at least two consecutive letters which are same

C = set of all 5 letter words containing no two consecutive letters which are same

count(A) = 26^5
count(C) = 26*25^4
count(C) = 26^5 - 26*25^4

Collections

Recap

In a sequence order matters

cat       act

even though both words have the same letters: {t, c, a}

\neq

Collections

In a collection order does not matter

cat  = cta = act = atc = tac = tca

all the 6 words have the same letters: {t, c, a}

\frac{n!}{(n-k)!}

a b c d e f g h i j k l m n o p q r s t u v w x y z

n = 26

k = 3

How many sequences of 3 letters can you form (no repetition)?

How many collections of 3 letters can you form (no repetition)?

We don't know!

But we know how to count sequences! Can we reuse that knowledge?

Sequences: Breaking it down

a b c d e f g h i j k l m n o p q r s t u v w x y z

26

3

Step 1: select the 3 letters to be put in the word

Step 2: re-arrange the 3 letters in 3! ways

a b c d e f g h i j k l m n o p q r s t u v w x y z

n

k

Step 1: select the k items to be put in the sequence

Step 2: re-arrange the k items in k! ways

Sequences: Breaking it down

Making a collection

Re-arranging elements in the collection

N = number of ways of selecting k elements

k! = number of ways of re-arranging the k terms

Sequences: Breaking it down

Making a collection

Re-arranging elements in the collection

Number of sequences

= N * k!
= \frac{n!}{(n-k)!}
\therefore N = \frac{n!}{(n-k)!k!}

What is the number of ways of selecting 3 vowels from 5 vowels ?

Collections Sequences
(a,e,i) {(a,e,i), (a,i,e), (e,a,i), (e,i,a), (i,a,e),(i,e,a)}
(a,e,o) {(a,e,o), (a,o,e), (e,a,o), (e,o,a), (o,a,e), (o,e,a)}
(a,e,u) {(a,e,u), (a,u,e), (e,a,u), (e,u,a), (u,a,e), (u,e,a)}
(a,i,o) {(a,i,o), (a,o,i), (i,a,o), (i,o,a), (o,a,i), (o,i,a)}
(a,i,u) {(a,i,u), (a,u,i), (i,a,u), (i,u,a), (u,a,i), (u,i,a)}
(a,o,u) {(a,o,u), (a,u,o), (o,a,u), (o,u,a), (u,a,o), (u,o,a)}
(e,i,o) {(e,i,o), (e,o,i), (i,e,o), (i,o,e), (o,e,i), (o,i,e)}
(e,i,u) {(e,i,u), (e,u,i), (i,e,u), (i,u,e), (u,e,i), (u,i,e)}
(e,o,u) {(e,o,u), (e,u,o), (o,e,u), (o,u,e), (u,e,o), (u,o,e)}
(i,o,u) {(i,o,u), (i,u,o), (o,i,u), (o,u,i), (u,i,o), (u,o,i)}

a e i o u

10

60

\frac{5!}{~2!~3!~}

3!

Sequences
{(a,e,i), (a,i,e), (e,a,i), (e,i,a), (i,a,e),(i,e,a)}
{(a,e,o), (a,o,e), (e,a,o), (e,o,a), (o,a,e), (o,e,a)}
{(a,e,u), (a,u,e), (e,a,u), (e,u,a), (u,a,e), (u,e,a)}
{(a,i,o), (a,o,i), (i,a,o), (i,o,a), (o,a,i), (o,i,a)}
{(a,i,u), (a,u,i), (i,a,u), (i,u,a), (u,a,i), (u,i,a)}
{(a,o,u), (a,u,o), (o,a,u), (o,u,a), (u,a,o), (u,o,a)}
{(e,i,o), (e,o,i), (i,e,o), (i,o,e), (o,e,i), (o,i,e)}
{(e,i,u), (e,u,i), (i,e,u), (i,u,e), (u,e,i), (u,i,e)}
{(e,o,u), (e,u,o), (o,e,u), (o,u,e), (u,e,o), (u,o,e)}
{(i,o,u), (i,u,o), (o,i,u), (o,u,i), (u,i,o), (u,o,i)}

Sequence or Collection?

15

P

VP

T

S

ABCD
ABDC
ACBD
ACDB
ADBC
ADCB
BACD
BADC
BCAD
BCDA
BDAC
BDCA
CABD
CADB
CBAD
CBDA
CDAB
CDBA
DABC
DACB
DBAC
DBCA
DCAB
DCBA

Given a class of 15 students, in how many ways can you form a committee of 4 members?

All these 4! = 24 sequences are equal in a collection

15

All these 4! = 24 sequences are equal in a collection

ABCD
ABDC
ACBD
ACDB
ADBC
ADCB
BACD
BADC
BCAD
BCDA
BDAC
BDCA
CABD
CADB
CBAD
CBDA
CDAB
CDBA
DABC
DACB
DBAC
DBCA
DCAB
DCBA
\frac{15!}{~~~~~(15-4)!~~~~~~}
\frac{~}{4!}
n \choose k

The number of ways of selecting kkk objects from given nnn objects is                     and is denoted as           n(n−.       1)(n−2)...(n−k+1)n (n-1) (n-2) ... (n-k+1)

\frac{n!}{(n-k)!k!}

Collections

(some examples)

 

10

Consider 10 people in a meeting. If each person shakes hands with every other person in the room what is the total number of handshakes ?

Consider 10 people in a meeting. If each person shakes hands with every other person in the room what is the total number of handshakes ?

10

2

{10 \choose 2} = 45

You are going on a vacation and your suitcase has space for 3 shirts only? In how many ways can you fill the suitcase?

3

10

You are going on a vacation and your suitcase has space for 3 shirts only? In how many ways can you fill the suitcase?

3

10

You are going on a vacation and your suitcase has space for 3 shirts only? In how many ways can you fill the suitcase?

3

10

{10 \choose 3} = 120

There are 6 points on a 2 - dimensional plane such that no 3 points are collinear. How many segments can you draw from these 6 points?

6

2

{6 \choose 2} = 15

How many triangles can be formed from the vertices of a polygon of n sides?

n = 8

k = 3

{n \choose 3}

Collections

(with repetitions)

 

Recap

Sequences

without repetitions

with repetitions

Collections

without repetitions

with repetitions

\frac{n!}{(n-k)!}
n^k
\frac{n!}{(n-k)!k!}
?

How many breakfast combos containing 5 items can you form if you are allowed to have multiple servings of the same dish?

5

10

How many breakfast combos containing 5 items can you form if you are allowed to have multiple servings of the same dish?

5

How many breakfast combos containing 5 items can you form if you are allowed to have multiple servings of the same dish?

5

How many breakfast combos containing 5 items can you form if you are allowed to have multiple servings of the same dish?

5

How many breakfast combos containing 5 items can you form if you are allowed to have multiple servings of the same dish?

5

How many breakfast combos containing 5 items can you form if you are allowed to have multiple servings of the same dish?

5

{14 \choose 5}

n original counters

{n+k-1 \choose k}

k-1 magic counters

The number of ways of selecting kkk objects from given nnn objects with repetitions is             n(n−.       1)(n−2)...(n−k+1)n (n-1) (n-2) ... (n-k+1)

{n+k-1 \choose k}

(replicate any item which gets selected)

Summary

Sequences

without repetitions

with repetitions

Collections

without repetitions

with repetitions

\frac{n!}{(n-k)!}
n^k
\frac{n!}{(n-k)!k!}
{n+k-1 \choose k}

Collections

(+ multiplication principle)

 

Given a class of 7 boys and 8 girls, in how many ways can you form a committee of 4 members with 2 boys and 2 girls?

8

7

{8 \choose 2}
{7 \choose 2}
*

batsmen

keepers

pacers

spinners

7   

2   

4   

3   

Available

16

5  

1

3

2

Select

11

{7 \choose 5}
{2 \choose 1}
{4 \choose 3}
{3 \choose 2}
{7 \choose 5}
{2 \choose 1}
{4 \choose 3}
{3 \choose 2}
*
*
*

Total =   

(n−.       1)(n−2)...(n−k+1)n (n-1) (n-2) ... (n-k+1)

m_1 + m_2 + \dots + m_i = n
k_1 + k_2 + \dots + k_i = k
Given:n~items~of~i~different~types
{m_1 \choose k_1} * {m_2 \choose k_2} * \cdots * {m_i \choose k_i}
Form:collection~of~k~items

Collections

(+ subtraction principle)

 

3  cardiologists

4  diabetologists

2  neurologists

5  gynaecologists

7  general physicians

In how many ways can you form a 4-member committee containing at least one gynaecologist?

(total 21 doctors)

A = all possible committees of 4 members

B = all possible committees containing at least one gynaecologist

C = all possible committees containing no gynaecologist

count(A) = {21 \choose 4}
count(C) = {16 \choose 4}
count(B) = {21 \choose 4} - {16 \choose 4}

3  cardiologists

4  diabetologists

2  neurologists

5  gynaecologists

7  general physicians

(total 21 doctors)

Summary

 

Multiplication Principle

p*q*r*...

num. of choices at each step should be independent

address constraints first

Subtraction Principle

"at least one"

\frac{n!}{(n-k)!}
n^k
\frac{n!}{(n-k)!k!}
{n+k-1 \choose k}

Sequences

Collections

without repetitions

with repetitions

without repetitions

with repetitions

without repetitions

with repetitions

+ multiplication principle

+ multiplication/subtraction principle

Made with Slides.com