SlideShare a Scribd company logo
1 of 19
MTH 263
Probability and Random Variables
                 Lecture 5, Chapter 3
                     Dr. Sobia Baig
         Electrical Engineering Department
  COMSATS Institute of Information Technology, Lahore
Contents
• The Geometric Probability Law
• Sequences of Dependent Experiments
• A COMPUTER METHOD FOR SYNTHESIZING
  RANDOMNESS: RANDOM NUMBER GENERATORS
• Simulation of Random Experiments




        Probability and Random Variables, Lecture 5, by Dr. Sobia Baig   2
The Geometric Probability Law
• Consider a sequential experiment in which we repeat
  independent Bernoulli trials until the occurrence of the
  first success.
• Let the outcome of this experiment be m, the number
  of trials carried out until the occurrence of the first
  success.
• The sample space for this experiment is the set of
  positive integers.
• The probability, p(m), that m trials are required is
  found by noting that this can only happen if the first m-
  1 trials result in failures and the mth trial in success.
• The probability of this event is

            Probability and Random Variables, Lecture 5, by Dr. Sobia Baig   3
|The Geometric Probability Law




     Probability and Random Variables, Lecture 5, by Dr. Sobia Baig   4
Error Control by Retransmission
• Computer A sends a message to computer B over an
  unreliable radio link. The message is encoded so that B can
  detect when errors have been introduced into the message
  during transmission. If B detects an error, it requests A to
  retransmit it. If the probability of a message transmission
  error is q=0.1 what is the probability that a message needs
  to be transmitted more than two times?
• Each transmission of a message is a Bernoulli trial with
  probability of success p=1-q
• The Bernoulli trials are repeated until the first success
  (error-free transmission).The probability that more than
  two transmissions are required is given by Eq. (2.43):


             Probability and Random Variables, Lecture 5, by Dr. Sobia Baig   5
Sequences of Dependent Experiments
•   we consider a sequence or “chain” of subexperiments in which the outcome of a
    given subexperiment determines which subexperiment is performed next.
• Example
• A sequential experiment involves repeatedly drawing a ball from
  one of two urns, noting the on the ball, and replacing the ball in its
  urn.
• Urn 0 contains a ball with the number 1 and two balls with the
  number 0, and urn 1 contains five balls with the number 1 and one
  ball with the number 0.
• The urn from which the first draw is made is selected at random by
  flipping a fair coin. Urn 0 is used if the outcome is heads and urn 1 if
  the outcome is tails. Thereafter the urn used in a subexperiment
  corresponds to the number on the ball selected in the previous
  subexperiment.


                  Probability and Random Variables, Lecture 5, by Dr. Sobia Baig    6
• The sample space of this experiment consists of sequences of 0s
  and 1s.
• Each possible sequence corresponds to a path through the “trellis”
  diagram shown in Fig. 2.15(a).
• The nodes in the diagram denote the urn used in the nth
  subexperiment, and the labels in the branches denote the outcome
  of a subexperiment.
• Thus the path 0011 corresponds to the sequence:The coin toss was
  heads so the first draw was from urn 0; the outcome of the first
  draw was 0, so the second draw was from urn 0; the outcome of
  the second draw was 1, so the third draw was from urn 1;
• and the outcome from the third draw was 1, so the fourth draw is
  from urn 1.



              Probability and Random Variables, Lecture 5, by Dr. Sobia Baig   7
Trellis Diagram




Probability and Random Variables, Lecture 5, by Dr. Sobia Baig   8
• Find the probability of the sequence 0011 for the
  urn experiment introduced in Previous Example
• urn 0 contains two balls with label 0 and one ball
  with label 1, and that urn 1 contains five balls
  with label 1 and one ball with label 0.
• We can readily compute the probabilities of
  sequences of outcomes by labeling the branches
  in the trellis diagram with the probability of the
  corresponding transition.
• Thus the probability of the sequence 0011 is
  given by
           Probability and Random Variables, Lecture 5, by Dr. Sobia Baig   9
Probability and Random Variables, Lecture 5, by Dr. Sobia Baig   10
A COMPUTER METHOD FOR SYNTHESIZING
  RANDOMNESS: RANDOM NUMBER GENERATORS

• |Any computer simulation of a system that
  involves randomness must include a method
  for generating sequences of random numbers.
• These random numbers must satisfy long-
  term average properties of the processes they
  are simulating.
• we focus on the problem of generating
  random numbers that are “uniformly
  distributed” in the interval [0, 1].

          Probability and Random Variables, Lecture 5, by Dr. Sobia Baig   11
Random Number Generation
• there are an uncountably infinite number of
  points in the interval,but the computer is limited
  to representing numbers with finite precision
  only.
• We must therefore be content with generating
  equiprobable numbers from some finite set, say
  {0,1, …M-1}or{1,… M}
• By dividing these numbers by M, we obtain
  numbers in the unit interval.
• These numbers can be made increasingly dense
  in the unit interval by making M very large.
           Probability and Random Variables, Lecture 5, by Dr. Sobia Baig   12
Random Number Generation …
• Find a mechanism for generating random numbers.
• The direct approach involves performing random experiments. For
  example, we can generate integers in the range 0 to M-1 by flipping
  a fair coin m times and replacing the sequence of heads and tails by
  0s and 1s to obtain the binary representation of an integer.
• Another example would involve drawing a ball from an urn
  containing balls numbered 1 to M.
• Computer simulations involve the generation of long sequences of
  random numbers.
• If we were to use the above mechanisms to generate random
  numbers, we would have to perform the experiments a large
  number of times and store the outcomes in computer storage for
  access by the simulation program.
• It is clear that this approach is cumbersome and quickly becomes
  impractical.

               Probability and Random Variables, Lecture 5, by Dr. Sobia Baig   13
Pseudo-Random Number Generation




      Probability and Random Variables, Lecture 5, by Dr. Sobia Baig   14
Simulation of Random Experiments




      Probability and Random Variables, Lecture 5, by Dr. Sobia Baig   15
Probability and Random Variables, Lecture 5, by Dr. Sobia Baig   16
Probability and Random Variables, Lecture 5, by Dr. Sobia Baig   17
Probability and Random Variables, Lecture 5, by Dr. Sobia Baig   18
Probability and Random Variables, Lecture 5, by Dr. Sobia Baig   19

More Related Content

Similar to Mth263 lecture 6

Mth263 lecture 5
Mth263 lecture 5Mth263 lecture 5
Mth263 lecture 5
tariq88
 
Mth263 lecture 4
Mth263 lecture 4Mth263 lecture 4
Mth263 lecture 4
tariq88
 
Mth263 lecture 1
Mth263 lecture 1Mth263 lecture 1
Mth263 lecture 1
tariq88
 
Mth263 lecture 1
Mth263 lecture 1Mth263 lecture 1
Mth263 lecture 1
tariq88
 
Binomial distribution good
Binomial distribution goodBinomial distribution good
Binomial distribution good
Zahida Pervaiz
 
Mth263 lecture 2
Mth263 lecture 2Mth263 lecture 2
Mth263 lecture 2
tariq88
 
Mth263 lecture 2
Mth263 lecture 2Mth263 lecture 2
Mth263 lecture 2
tariq88
 
Statistical Significance Testing in Information Retrieval: An Empirical Analy...
Statistical Significance Testing in Information Retrieval: An Empirical Analy...Statistical Significance Testing in Information Retrieval: An Empirical Analy...
Statistical Significance Testing in Information Retrieval: An Empirical Analy...
Julián Urbano
 
4.2 binomial distributions
4.2 binomial distributions4.2 binomial distributions
4.2 binomial distributions
tintinsan
 

Similar to Mth263 lecture 6 (20)

Mth263 lecture 5
Mth263 lecture 5Mth263 lecture 5
Mth263 lecture 5
 
Mth263 lecture 4
Mth263 lecture 4Mth263 lecture 4
Mth263 lecture 4
 
Module 1 sp
Module 1 spModule 1 sp
Module 1 sp
 
Mth263 lecture 1
Mth263 lecture 1Mth263 lecture 1
Mth263 lecture 1
 
Mth263 lecture 1
Mth263 lecture 1Mth263 lecture 1
Mth263 lecture 1
 
Binomial distribution good
Binomial distribution goodBinomial distribution good
Binomial distribution good
 
Mth263 lecture 2
Mth263 lecture 2Mth263 lecture 2
Mth263 lecture 2
 
Mth263 lecture 2
Mth263 lecture 2Mth263 lecture 2
Mth263 lecture 2
 
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
 
Chi square
Chi squareChi square
Chi square
 
Unit 3 random number generation, random-variate generation
Unit 3 random number generation, random-variate generationUnit 3 random number generation, random-variate generation
Unit 3 random number generation, random-variate generation
 
chi-Square. test-
chi-Square. test-chi-Square. test-
chi-Square. test-
 
Probability Theory for Data Scientists
Probability Theory for Data ScientistsProbability Theory for Data Scientists
Probability Theory for Data Scientists
 
5. RV and Distributions.pptx
5. RV and Distributions.pptx5. RV and Distributions.pptx
5. RV and Distributions.pptx
 
Statistical Significance Testing in Information Retrieval: An Empirical Analy...
Statistical Significance Testing in Information Retrieval: An Empirical Analy...Statistical Significance Testing in Information Retrieval: An Empirical Analy...
Statistical Significance Testing in Information Retrieval: An Empirical Analy...
 
Probability
ProbabilityProbability
Probability
 
Statistical tests
Statistical testsStatistical tests
Statistical tests
 
Artificial Intelligence Notes Unit 3
Artificial Intelligence Notes Unit 3Artificial Intelligence Notes Unit 3
Artificial Intelligence Notes Unit 3
 
4.2 binomial distributions
4.2 binomial distributions4.2 binomial distributions
4.2 binomial distributions
 
PSUnit_I_Lesson_2_Constructing_Probability_Distributions.pptx
PSUnit_I_Lesson_2_Constructing_Probability_Distributions.pptxPSUnit_I_Lesson_2_Constructing_Probability_Distributions.pptx
PSUnit_I_Lesson_2_Constructing_Probability_Distributions.pptx
 

Mth263 lecture 6

  • 1. MTH 263 Probability and Random Variables Lecture 5, Chapter 3 Dr. Sobia Baig Electrical Engineering Department COMSATS Institute of Information Technology, Lahore
  • 2. Contents • The Geometric Probability Law • Sequences of Dependent Experiments • A COMPUTER METHOD FOR SYNTHESIZING RANDOMNESS: RANDOM NUMBER GENERATORS • Simulation of Random Experiments Probability and Random Variables, Lecture 5, by Dr. Sobia Baig 2
  • 3. The Geometric Probability Law • Consider a sequential experiment in which we repeat independent Bernoulli trials until the occurrence of the first success. • Let the outcome of this experiment be m, the number of trials carried out until the occurrence of the first success. • The sample space for this experiment is the set of positive integers. • The probability, p(m), that m trials are required is found by noting that this can only happen if the first m- 1 trials result in failures and the mth trial in success. • The probability of this event is Probability and Random Variables, Lecture 5, by Dr. Sobia Baig 3
  • 4. |The Geometric Probability Law Probability and Random Variables, Lecture 5, by Dr. Sobia Baig 4
  • 5. Error Control by Retransmission • Computer A sends a message to computer B over an unreliable radio link. The message is encoded so that B can detect when errors have been introduced into the message during transmission. If B detects an error, it requests A to retransmit it. If the probability of a message transmission error is q=0.1 what is the probability that a message needs to be transmitted more than two times? • Each transmission of a message is a Bernoulli trial with probability of success p=1-q • The Bernoulli trials are repeated until the first success (error-free transmission).The probability that more than two transmissions are required is given by Eq. (2.43): Probability and Random Variables, Lecture 5, by Dr. Sobia Baig 5
  • 6. Sequences of Dependent Experiments • we consider a sequence or “chain” of subexperiments in which the outcome of a given subexperiment determines which subexperiment is performed next. • Example • A sequential experiment involves repeatedly drawing a ball from one of two urns, noting the on the ball, and replacing the ball in its urn. • Urn 0 contains a ball with the number 1 and two balls with the number 0, and urn 1 contains five balls with the number 1 and one ball with the number 0. • The urn from which the first draw is made is selected at random by flipping a fair coin. Urn 0 is used if the outcome is heads and urn 1 if the outcome is tails. Thereafter the urn used in a subexperiment corresponds to the number on the ball selected in the previous subexperiment. Probability and Random Variables, Lecture 5, by Dr. Sobia Baig 6
  • 7. • The sample space of this experiment consists of sequences of 0s and 1s. • Each possible sequence corresponds to a path through the “trellis” diagram shown in Fig. 2.15(a). • The nodes in the diagram denote the urn used in the nth subexperiment, and the labels in the branches denote the outcome of a subexperiment. • Thus the path 0011 corresponds to the sequence:The coin toss was heads so the first draw was from urn 0; the outcome of the first draw was 0, so the second draw was from urn 0; the outcome of the second draw was 1, so the third draw was from urn 1; • and the outcome from the third draw was 1, so the fourth draw is from urn 1. Probability and Random Variables, Lecture 5, by Dr. Sobia Baig 7
  • 8. Trellis Diagram Probability and Random Variables, Lecture 5, by Dr. Sobia Baig 8
  • 9. • Find the probability of the sequence 0011 for the urn experiment introduced in Previous Example • urn 0 contains two balls with label 0 and one ball with label 1, and that urn 1 contains five balls with label 1 and one ball with label 0. • We can readily compute the probabilities of sequences of outcomes by labeling the branches in the trellis diagram with the probability of the corresponding transition. • Thus the probability of the sequence 0011 is given by Probability and Random Variables, Lecture 5, by Dr. Sobia Baig 9
  • 10. Probability and Random Variables, Lecture 5, by Dr. Sobia Baig 10
  • 11. A COMPUTER METHOD FOR SYNTHESIZING RANDOMNESS: RANDOM NUMBER GENERATORS • |Any computer simulation of a system that involves randomness must include a method for generating sequences of random numbers. • These random numbers must satisfy long- term average properties of the processes they are simulating. • we focus on the problem of generating random numbers that are “uniformly distributed” in the interval [0, 1]. Probability and Random Variables, Lecture 5, by Dr. Sobia Baig 11
  • 12. Random Number Generation • there are an uncountably infinite number of points in the interval,but the computer is limited to representing numbers with finite precision only. • We must therefore be content with generating equiprobable numbers from some finite set, say {0,1, …M-1}or{1,… M} • By dividing these numbers by M, we obtain numbers in the unit interval. • These numbers can be made increasingly dense in the unit interval by making M very large. Probability and Random Variables, Lecture 5, by Dr. Sobia Baig 12
  • 13. Random Number Generation … • Find a mechanism for generating random numbers. • The direct approach involves performing random experiments. For example, we can generate integers in the range 0 to M-1 by flipping a fair coin m times and replacing the sequence of heads and tails by 0s and 1s to obtain the binary representation of an integer. • Another example would involve drawing a ball from an urn containing balls numbered 1 to M. • Computer simulations involve the generation of long sequences of random numbers. • If we were to use the above mechanisms to generate random numbers, we would have to perform the experiments a large number of times and store the outcomes in computer storage for access by the simulation program. • It is clear that this approach is cumbersome and quickly becomes impractical. Probability and Random Variables, Lecture 5, by Dr. Sobia Baig 13
  • 14. Pseudo-Random Number Generation Probability and Random Variables, Lecture 5, by Dr. Sobia Baig 14
  • 15. Simulation of Random Experiments Probability and Random Variables, Lecture 5, by Dr. Sobia Baig 15
  • 16. Probability and Random Variables, Lecture 5, by Dr. Sobia Baig 16
  • 17. Probability and Random Variables, Lecture 5, by Dr. Sobia Baig 17
  • 18. Probability and Random Variables, Lecture 5, by Dr. Sobia Baig 18
  • 19. Probability and Random Variables, Lecture 5, by Dr. Sobia Baig 19