Presentation is loading. Please wait.

Presentation is loading. Please wait.

Section 7.3. Why we need Bayes?  How to assess the probability that a particular event occurs on the basis of partial evidence.  The probability p(F)

Similar presentations


Presentation on theme: "Section 7.3. Why we need Bayes?  How to assess the probability that a particular event occurs on the basis of partial evidence.  The probability p(F)"— Presentation transcript:

1 Section 7.3

2 Why we need Bayes?  How to assess the probability that a particular event occurs on the basis of partial evidence.  The probability p(F) that an event F occurs and we have knowledge that an event E occurs. Then the conditional probability that F occurs given that E occurs, p(F|E), is a more realistic estimate than p(F) that F occurs.

3 Example  Selects a ball by first choosing one of the two boxes at random.  Selects one of the balls in this box at random.  If bob selected a red ball, what is the probability that he selected a ball from the first box.

4 Solution

5 Bayes’ Theorem

6 Example  Suppose one person in 100,000 has a particular rare  disease for which there is a fairly accurate diagnostic test. This test is correct 99% of the time when given to someone with the disease; it is correct 99.5% of the time when given to someone who does not have the disease.  P(someon who test positive actually have the disease)?  P(someone who tests negative for the desease does not have the disease)?  F: a person has the disease  E: a person tests positive Only 0.2% of people who test positive actually have the disease.

7 Example  Suppose one person in 100,000 has a particular rare disease for which there is a fairly accurate diagnostic test. This test is correct 99% of the time when given to someone with the disease; it is correct 99.5% of the time when given to someone who does not have the disease.  P(someon who test positive actually have the disease)?  P(someone who tests negative does not have the disease)?  F: a person has the disease  E: a person tests positive 99.99999% of people who test negative really do not have the disease.

8 Section 7.4

9 Expected value The expected value of a random variable is the sum over all elements in a sample space of the product of the probability of the element and the value of the random variable at this element. The weighted average of the values of a random variable  Example Let X be the number that comes up when a die is rolled. What is the expected value of X?

10 Linearity of Expectations If X i (i=1, 2, …, n) are random variables on S, and if a and b are real numbers, then i. E(X 1 +X 2 +…+X n ) = E(X 1 )+E(X 2 )+…+E(X n ) ii. E(aX+b)=aE(X)+b

11  Definition 6: A random variable is a function from the sample space of an experiment to the set of real numbers. That is, a random variable assigns a real number to each possible outcome.  A random variable is a function, not a variable  Definition 7: The distribution of a random variable X on a sample space S is the set of pairs (r, p(X=r)) for all r in X(S), where p(X=r) is the probability that X takes the value r.  The set of pairs in this distribution is determined by the probabilities p(X=r) for all r in X(S). Random variables

12  Example: Suppose that a coin is flipped three times. Let X(t) be the random variable that equals the number of heads that appear when t is the outcome. Then  X(HHH)=3  X(HHT)=X(HTH)=X(THH)=2  X(TTH)=X(THT)=X(HTT)=1  X(TTT)=0 Random variables

13  Let X be the sum of the numbers that appear when dice is rolled. What are the values of this random variable for the 36 possible outcomes ( i, j ), where i and j are the numbers that appear on the first die and the second die, respectively, when these two dice are rolled?  X((1,1))=2  X((1,2))=X((2,1))=3  X((1,3))=X((2,2))=X((3,1))=4  X((1,4))=X((2,3))=X((3,2))=X((4,1))=5  X((1,5))=X((2,4))=X((3,3))=X((4,2))=X((5,1))=6  X((1,6))=X((2,5))=X((3,4))=X((4,3))=X((5,2))=X((6,1))=7  X((2,6))=X((3,5))=X((4,4))=X((5,3))=X((6,2))=8  X((3,6))=X((4,5))=X((5,4))=X((6,3))=9  X((4,6))=X((5,5))=X((6,4))=10  X((5,6))=X((6,5))=11  X((6,6))=12 Example

14  Example: Find the expected value of the sum of the numbers that appear when a pair of fair dice is rolled. X((1,1))=2 X((1,2))=X((2,1))=3 X((1,3))=X((2,2))=X((3,1))=4 X((1,4))=X((2,3))=X((3,2))=X((4,1))=5 X((1,5))=X((2,4))=X((3,3))=X((4,2))=X((5,1))=6 X((1,6))=X((2,5))=X((3,4))=X((4,3))=X((5,2))=X((6,1))=7 X((2,6))=X((3,5))=X((4,4))=X((5,3))=X((6,2))=8 X((3,6))=X((4,5))=X((5,4))=X((6,3))=9 X((4,6))=X((5,5))=X((6,4))=10 X((5,6))=X((6,5))=11 X((6,6))=12

15 Example  A new employee checks the hats of n people at a restaurant, forgetting to put claim check numbers on the hats. When customers return for their hats, the checker gives them back hats chosen at random from the remaining hats. What is the expected number of hats that are returned correctly?  Solution: X=X 1 +…+X n : the number of people who receive the correct hat X i =1 : i th person receives the correct hat X i =0 : otherwise E(X)=E(X 1 )+…+E(X n ) p(x i =1)=1/n, E(X i )=1*p(x i =1)+0*p(x i =0)=1/n E(X)=1 The number of people who receive the correct hat is 1

16 Variance and Standard Deviation  How widely the values of a random variable are distributed?  Let X be a random variable on a sample space S. The variance of X, denoted by V(X), is  The standard deviation of X, denoted by δ(X), is defined to be  If X is a random variable on a sample space S, then V(X)=E(X 2 )-E(X) 2.  If X and Y are two independent random variables on a sample space S, then V(X+Y)=V(X)+V(Y). Furthermore, if X i (i=1, 2, …, n) are pairwise independent random variables on S, then V(X 1 +X 2 +…+X n )=V(X 1 )+V(X 2 )+…+V(X n ).

17 Example  The variance of the random variable X whose value is the number of heads when tossing a coin twice.  Solution:  a coin is tossed twice, the number of heads is: 0 with probability 0.25, 1 with probability 0.5 and 2 with probability 0.25.  X: the number of heads  E(X)=0.25 × 0 + 0.5 × 1 + 0.25 × 2 = 1,  variance is V(X)=0.25 × (0 − 1) 2 + 0.5 × (1 − 1) 2 + 0.25 × (2 − 1) 2 = 0.25 + 0 + 0.25 = 0.5.

18  Bernoulli trial: an experiment with only two possible outcomes  A possible outcome of a Bernoulli trial is called a success or a failure.  If p is the probability of a success and q is the probability of a failure, it follows that p+q=1.  Theorem: The probability of exactly k successes in n independent Bernoulli trials, with probability of success p and probability of failure q=1- p, is b=(k;n,p)=C(n,k)p k q n-k. Considered as a function of k, the function is called the binomial distribution.  Example: suppose that the probability that a 0 bit is generated is 0.9, that the probability that a 1 bit is generated is 0.1, and that bits are generated independently. What is the probability that exactly eight 0 bits are generated when 10 bits are generated?  Solution : b(8;10,0.9)=C(10,8)(0.9) 8 (0.1) 2 =0.1937  Theorem: The expected number of successes when n independent Bernoulli trials are performed, where p is the probability of success on each trial, is np. Bernoulli trials & the binomial distribution


Download ppt "Section 7.3. Why we need Bayes?  How to assess the probability that a particular event occurs on the basis of partial evidence.  The probability p(F)"

Similar presentations


Ads by Google