Announcements: Weekly Reading Assignment: Chapter 9 (CLRS) (Not On This Exam)
Announcements: Weekly Reading Assignment: Chapter 9 (CLRS) (Not On This Exam)
i = 0 to n-1
O(E[n
i
2
]) =
O(
i = 0 to n-1
E[n
i
2
] ) = O(n)
E[n
i
2
] = Var[n
i
] + E
2
[n
i
]
= n p (1 - p) + 1
2
= 1 - (1/n) + 1
= 2 - 1/n = (1)
Review: Binomial Distribution
Given n independent trials, each trial has two
possible outcomes. Such trials are called
Bernoulli trials. If p is the probability of
getting a head, then the probability of getting
k heads in n tosses is given by (CLRS p.1203)
P(X=k) = (n!/(k!(n-k)!)) p
k
(1-p)
n-k
= b(k;n,p)
This probability distribution is called the
binomial distribution. p
k
is the probability of
tossing k heads and (1-p)
n-k
is the probability
of tossing n-k tails. (n!/(k!(n-k)!)) is the total
number of different ways that the k heads
could be distributed among n tosses.
Review: Binomial Distribution
See p. 1203-1205 for the derivations.
E[x] = n p
Var[x] = E[X
2
] - E
2
[X] = n p (1-p)
E[X
2
] = Var[X] + E
2
[X]
= n p (1-p) + (n p)
2
= 1(1-p) + 1
2