3.2 BINOMIAL DISTRIBUTION CONTENTS 3.2 Binomial Distribution ................................................................................................... 2 3.2.1 Characteristics of a Binomial Experiment ...........................................................2 3.2.2 Binomial Probability Distribution Function ........................................................2 3.2.3 Mean and Variance of Binomial Distribution ......................................................5 3.2.4 Application of Binomial Distribution in Computer Science................................6 3.2 EXERCISES ................................................................................................................. 6 EXAMPLES Example 1: Binomial Distribution: Tossing a coin 6 times problem ................................................... 2 Example 2: Binomial Distribution: Telemarketer’s problem .............................................................. 3 Example 3: Binomial Distribution: Mean and standard deviation of die problem .............................. 5 1 3.1 Binomial Distribution 3.2.1 Characteristics of a Binomial Experiment 1. 2. 3. 4. The experiment consists of n identical and independent trials. There are only two possible outcomes on each trial. We will denote one outcome by S (for success) and the other by F (for failure). The probability of S or F remains the same from trial to trial. The probability of S is denoted by p, and the probability of F is denoted by q. Note that q = 1 – p. Random Variable X, is the number of successes in the n trials is said to follow Binomial Distribution with parameters n and p (x=0,1,2,3,…,n) Remark: Notation: X~b(x; n, p) 3.2.2 Binomial Probability Distribution Function Definition: The probability of exactly x successes in n repeated trials is given by n! b(x; n, p) = p( x ) nCx p x qn x p x (1 p)n x x ! (n x )! Where: n Cx = the binomial coefficient p = Probability of a ‘Success’ on a single trial q = (1 – p): Probability of a ‘Failure’ on a single trial n = Number of identical and independent trials x = Number of ‘Successes’ in n trials (x = 0, 1, 2, ..., n) n–x = Number of failures in n trials Example 1: Binomial Distribution: Tossing a coin 6 times problem A coin is tossed 6 times in a row. Note the number of heads as success. Find the probability of i. ii. iii. iv. Getting exactly 2 heads Getting at least 4 heads No heads At least one head i. The probability of getting exactly 2 heads The formula for probability of exactly x successes in n repeated trials is given by n! p ( x ) nC x p x q n x p x (1 p)n x x ! (n x )! Given, n=6; p=1/2 and x=2 i.e find p(2). 2 6 2 2 4 6! 6! 1 1 1 1 15 Thus, p(2) 2!(6 2)! 2 2 2!(6 2)! 2 2 64 2 ii. The probability of getting at least 4 heads The formula for probability of exactly x successes in n repeated trials is given by n! p x (1 p)n x x ! (n x )! Given, n=6; p=1/2 ; x=4,5,6 p ( x ) nC x p x q n x To find, p(at least 4 heads) =p(x≥4) = p(4)+p(5)+p(6) 4 64 4 2 6! 1 1 4!(6 4)! 2 2 5 6! 1 1 5!(6 5)! 2 2 5 6 5 6 6! 1 1 6!(6 6)! 2 2 1 6 6! 6! 6! 1 1 1 1 1 1 4!(6 4)! 2 2 5!(6 5)! 2 2 6!(6 6)! 2 2 =15/64 + 6/64 +1/64 = 22/64 =11/32 6 0 0 iii. The probability of no heads The formula for probability of exactly x successes in n repeated trials is given by n! p ( x ) nC x p x q n x p x (1 p)n x x ! (n x )! Given, n=6; p=1/2 ; x=0 0 6 6 6! 1 1 1 1 p(0) 0!(6 0)! 2 2 2 64 iv. The probability of at least one head The formula for probability of exactly x successes in n repeated trials is given by n! p ( x ) nC x p x q n x p x (1 p)n x x ! (n x )! Given, n=6; p=1/2 ; x=1,2,3,4,5,6 To find, p(at least 1 heads) = p(x≥1) =p(1)+p(2)+p(3)+p(4)+p(5)+p(6) =1-p(0) 0 6 6 6! 1 63 1 1 1 1 p(0) 1 1 64 64 0!(6 0)! 2 2 2 Example 2: Binomial Distribution: Telemarketer’s problem You are a telemarketer selling service contracts for Macy’s. You have sold 20 in your last 100 calls. If you call 12 people tonight, what’s the probability of A. B. C. D. No sales? Exactly 2 sales? At most 2 sales? At least 2 sales? 3 Solution Given: n = 12, p =20/100=1/5 n! p ( x ) nC x p x q n x p x (1 p)n x x ! (n x )! A. Probability of no sale i.e. x=0 0 12 12! 1 4 p(0) 0!(12 0)! 5 5 p(0) = .0687 B. Probability of exactly two sales 2 12 2 12! 1 4 p(2) 2!(12 2)! 5 5 p(2) = 0.2835 C. Probability of at most two sales: p(at most 2) = p(0) + p(1) + p(2) 0 120 12! 1 4 p(0) 0.0687 0!(12 0)! 5 5 121 1 p(1) 12! 1 4 1!(12 1)! 5 5 2 0.2062 12 2 12! 1 4 p(2) 0.2835 2!(12 2)! 5 5 Thus, p(at most 2)= p(X≤2) = p(0) + p(1) + p(2) = .0687 + .2062 + .2835 = 0.5584 D. Probability of at least two sales p(at least 2) = p(x≥2) = p(2) + p(3)...+ p(12) = 1 – [p(0) + p(1)] Where, 0 12 12! 1 4 p(0) 0.0687 0!(12 0)! 5 5 1 121 12! 1 4 p(1) 0.2062 1!(12 1)! 5 5 = 1 – .0687 – .2062= 0.7251 4 Theorem (ASIDE): Show that p(x) is the probability distribution i.e. Σ p(x) = 1 Solution: n n Binomial Expansion Formula: ( a b) n a i bn i i 0 i n n n p( x ) p x (1 p ) n x x 0 x 0 x Here a p and b (1 p ), p (1 p ) 1 n p(x) is a "Legitimate" Probability Distribution QED 3.2.3 Mean and Variance of Binomial Distribution Mean µ= E(x) =np Standard Deviation npq Example 3: Binomial Distribution: Mean and standard deviation of die problem (i) A fair die is tossed 180 times. Find the expected number of times the face 6 occurs and the standard deviation. Solution: A fair die is tossed 180 times, p=1/6; q = (1-p) = 5/6. The expected number of sixes is µ= np = 180 x 1/6 =30. The standard deviation is npq =√180 x (1/6) x(5/6) = 5 (ii) A recent survey found that 61% of all adults aged 50 years and over wear glasses for driving. In a random sample of 70 adults over 50 what is the mean and standard deviation of the number who wear glasses? Solution: Probability of wearing glasses for driving of adults over 50 is p=0.61 and q=(1-p) = (1-0.61) =0.39 The number of adults sampled (=n) = 70) As this follows the Binomial distribution, the Mean = np = 70 x 0.61 =42.7 Number of adults wearing glasses. Variance = npq =70 x 0.61 x 0.39 =16.653 5 3.2.4 Application of Binomial Distribution in Computer Science To model the number of successes 1. The number of processors that are up in a multiprocessor system. 2. The number of packets that reach the destination without loss. 3. The number of bits in a packet that are not affected by noise. 4. The number of items in a batch that have certain characteristics. 3.2 EXERCISES Q1. What are the characteristics of a binomial experiment? Q 2. Define binomial probability distribution function. Q 3. A coin is tossed 5 times in a row. Note the number of heads as success. Find the probability of getting: 1. exactly 3 heads 2. at least 4 heads 3. at most 2 heads 4. No heads 5. At least one head Q4. A recent survey found that 61% of all adults over 50 wear glasses for driving. In random sample of 70 adults over 50 what is the mean and standard deviation of the number who wear glasses? (Answer: Mean 42.7 adults over 50 wear glasses and standard deviation: 4.08) Q5. A fair die is tossed 7 times, call a toss a success (p) if a 5 or a 6 appears. Find the probability that a 5 or a 6 occurs exactly 3 times (i.e. X=3). Ans.: p(X=3) = 560/2187 6