This preview shows pages 1–2. Sign up to view the full content.
CS 70
Discrete Mathematics for CS
Fall 2006
Lecture 20
Counting and Probability
The topic for the third and final major portion of the course is Discrete Probability. Suppose you toss a fair
coin a thousand times. How likely is it that you get exactly 500 heads? And what about 1000 heads? It turns
out that the chances of 500 heads are roughly 5%, whereas the chances of 1000 heads are so infinitesimally
small that we may as well say that it is impossible. But before you can learn to compute or estimate odds or
probabilities you must learn to count! That is the subject of this lecture.
We will learn how to count the number of outcomes while tossing coins, rolling dice and dealing cards.
Many of the questions we will be interested in can be cast in the following simple framework called the
occupancy model:
Balls in Bins:
We have a set of
k
balls. We wish to place them into
n
bins. How many different possible
outcomes are there?
How do we represent coin tossing and card dealing in this framework? Consider the case of
n
=
2 bins
labelled
H
and
T
, corresponding to the two outcomes of a coin toss. The placement of the
k
balls correspond
to the outcomes of
k
successive coin tosses. To model card dealing, consider the situation with 52 bins
corresponding to a deck of cards. Here the balls correspond to successive cards in a deal.
The two examples illustrate two different constraints on ball placements. In the coin tossing case, different
balls can be placed in the same bin. This is called
sampling with replacement
. In the cards case, no bin
can contain more than one ball (i.e., the same card cannot be dealt twice). This is called
sampling without
replacement
. As an exercise, what are
n
and
k
for rolling dice? Is it sampling with or without replacement?
We are interested in counting the number of ways of placing
k
balls in
n
bins in each of these scenarios. This
is easy to do by applying the first rule of counting:
First Rule of Counting:
If an object can me made by a succession of choices, where there are
n
1
ways
of making the first choice, and
for every
way of making the first choice there are
n
2
ways of making the
second choice, and
for every
way of making the first and second choice there are
n
3
ways of making the
third choice, and so on up to the
n
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview. Sign up
to
access the rest of the document.
This note was uploaded on 11/03/2008 for the course CMPSC 360 taught by Professor Haullgren during the Fall '08 term at Pennsylvania State University, University Park.
 Fall '08
 HAULLGREN

Click to edit the document details