Introduction to Probability for Computer Scientists
CS109 Lecture 2
Elmer Le & Kevin Shin
June 25, 2015
Le, Shin
Counting: Combinatorics
Outline
1
Why Learn about More Counting?
2
Counting Ordered Arrangements of Distinct Objects: Permutations
Permutation
The Tragedy of Conditional Probability
Thanks xkcd!
http:/xkcd.com/795/
A Few Useful Formulas
For any events A and B:
P(A B)
= P(B A)
(Commutativity)
P(A B)
= P(A | B) P(B)
= P(B | A) P(A)
(Chain rule)
P(A Bc) = P(A) P(AB)
P(A B)
P(A) + P(B) 1
(Intersect
n
Recursive definition of
k
Lets write a function C(n, k)
The number of ways to select k objects from a set of n objects.
C(n,k)
C(n,k)
Select any one of the n points in the group
C(n,k)
Separate this point from the rest
C(n,4)
Lets consider specific pr
Normal Random Variable
X is a Normal Random Variable: X ~ N(, 2)
Probability Density Function (PDF):
1
( x ) 2 / 2 2
f ( x) =
e
2
E[ X ] =
Var ( X ) =
2
where < x <
f (x)
Also called Gaussian
Note: f(x) is symmetric about
Common for natural phenome
From Urns to Coupons
Coupon Collecting is classic probability problem
Ask questions like:
There exist N different types of coupons
Each is collected with some probability pi (1 i N)
After you collect m coupons, what is probability you
have k different kin
Utility
Utility is value of some choice
2 choices, each with n consequences: c1, c2,., cn
One of ci will occur with probability pi
Each consequence has some value (utility): U(ci)
Which choice do you make?
Example: Buy a $1 lottery ticket (for $1M prize)?
Discrete Joint Mass Functions
For two discrete random variables X and Y, the
Joint Probability Mass Function is:
p X ,Y (a, b) = P( X = a, Y = b)
Marginal distributions:
p X (a ) = P ( X = a ) = p X ,Y (a, y )
y
pY (b) = P(Y = b) = p X ,Y ( x, b)
x
Exampl
Balls, Urns, and the Supreme Court
Supreme Court case: Berghuis v. Smith
If a group is underrepresented in a jury pool, how do you tell?
Article by Erin Miller Friday, January 22, 2010
Thanks to (former CS109er) Josh Falk for this article
Justice Breyer
Binary Search Tree
A binary search tree (BST), is a binary tree where for
every node n in the tree:
n's value is greater than all the values in its left subtree.
n's value is less than all the values in its right subtree.
both n's left and right subtrees
CS 109
Spring 2015
Homework 4
May 1st, 2015
Due: Friday, May 15th, 2015 5:00 PM
For each problem, briefly explain/justify how you obtained your answer.
This doesnt need to be a paragraph or even complete sentences.
This can be as simple as writing out y
Sample Spaces
Sample space, S, is set of all possible outcomes
of an experiment
Coin flip:
Flipping two coins:
Roll of 6-sided die:
# emails in a day:
YouTube hrs. in day:
S = cfw_Head, Tails
S = cfw_(H, H), (H, T), (T, H), (T, T)
S = cfw_1, 2, 3, 4, 5, 6
Whither the Binomial
Recall example of sending bit string over network
n = 4 bits sent over network where each bit had
independent probability of corruption p = 0.1
X = number of bits corrupted. X ~ Bin(4, 0.1)
In real networks, send large bit strings (le
Introduction to Probability for Computer Scientists
CS109 Lecture 1
Elmer Le & Kevin Shin
June 22, 2015
Le, Shin
Motivation & Counting
Outline
1
Introduction
Denition of Probability
Topics in Probability
2
Motivation
Probability in Computer Science
Probab
The Normal Distribution
image: Etsy
Will Monroe
July 19, 2017
with materials by
Mehran Sahami
and Chris Piech
Announcements: Midterm
A week from yesterday:
Tuesday, July 25, 7:00-9:00pm
Building 320-105
One page (both sides) of notes
Material through toda
Will Monroe
July 14, 2017
with materials by
Mehran Sahami
and Chris Piech
More discrete distributions
Announcements: Problem Set 3
Posted yesterday on the course website.
Due next Wednesday, 7/19, at 12:30pm (before class).
(election prediction)
(Moby Dic
Continuous distributions
Will Monroe
July 17, 2017
with materials by
Mehran Sahami
and Chris Piech
Announcements: Problem Set 3
Due this Wednesday, 7/19, at 12:30pm (before class).
(election prediction)
(Moby Dick)
Announcements: Midterm
A week from tomor
Will Monroe
July 21, 2017
with materials by
Mehran Sahami
and Chris Piech
Joint Distributions
Review: Normal random variable
An normal (= Gaussian) random variable is
a good approximation to many other
distributions. It often results from sums or
averages
Conditional distributions
Will Monroe
July 26, 2017
with materials by
Mehran Sahami
and Chris Piech
Independence of
discrete random variables
Two random variables are
independent if knowing the value
of one tells you nothing about the
value of the other (
1
Will Monroe
CS 109
Lecture Notes #13
July 24, 2017
Independent Random Variables
Based on a chapter by Chris Piech
Independence with Multiple RVs
Discrete: Two discrete random variables X and Y are called independent if:
P(X = x, Y = y) = P(X = x)P(Y = y
1
Will Monroe
CS 109
Problem Set #1
Due: 12:30pm on Wednesday, July 5th
Problem Set #1
June 28, 2017
With problems by Mehran Sahami and Chris Piech
For each problem, briefly explain/justify how you obtained your answer. Brief explanations of
your answer
Not Everything is Equally Likely
Say n balls are placed in m urns
Each ball is equally likely to be placed in any urn
Counts of balls in urns are not equally likely!
Example: two balls (A and B) placed with equal
likelihood in two urns (Urn 1 and Urn 2)
P
CS 109
Spring 2015
Homework 2
April 10th, 2015
Due: April 20th, 2015 5:00PM
For each problem, briefly explain/justify how you obtained your answer.
This doesnt need to be a paragraph or even complete sentences.
This can be as simple as writing out your
Welcome Back Our Friend: Expectation
Recall expectation for discrete random variable:
E[ X ] = x p ( x)
x
Analogously for a continuous random variable:
E[ X ] =
x f ( x) dx
Note: If X always between a and b then so is E[X]
More formally:
if P (a X b) = 1
Computing Probabilities from Data
Various probabilities you will need to compute for
Naive Bayesian Classifier (using MLE here):
# instances in class = 0
P (Y = 0) =
total # instances
# instances where X i = 0 and class = 0
P ( X i = 0, Y = 0) =
total # i
Chris Piech
CS109
Lecture Handout #4
April 10th , 2017
Conditional Probability and Bayes Theorem
An all knowing computer would be able to store what we call the joint probability of all possible combinations of events. That is not feasible.
Conditional Pr
Probability and Random Variables/Processes for Wireless Communication
Professor Aditya K. Jagannatham
Department of Electrical Engineering
Indian Institute of Technology Kanpur
Module No. 2
Lecture 9
Random Variables, Probability Density Function (PDF)
He
Probability and Random Variables/Processes for Wireless Communication
Professor Aditya K. Jagannatham
Department of Electrical Engineering
Indian Institute of Technology Kanpur
Module No. 1
Lecture 1
Basics -Sample Space and Events
Hello, welcome to this
Probability and Random Variables/Processes for Wireless Communication
Professor Aditya K. Jagannatham
Department of Electrical Engineering
Indian Institute of Technology Kanpur
Module 4
Lecture No 23
Gaussian Process Through LTI Syatem Example:WGN Through
Probability and Random Variables/Processes for Wireless Communication
Professor Aditya K. Jagannatham
Department of Electrical Engineering
Indian Institute of Technology Kanpur
Module No. 4
Lecture 21
Transmission of WSS Random Process Through LTI System
Probability and Random Variables / Processes for Wireless Communications
Professor Aditya K Jagannathan
Department of Electrical Engineering
Indian Institute of Technology, Kanpur
Module Number 03
Lecture Number 14
Gaussian Random Variable and Linear Tran