Simulation allows us to perform experiments without actually having to do the experiments in real li - PowerPoint PPT Presentation

1 / 2
About This Presentation
Title:

Simulation allows us to perform experiments without actually having to do the experiments in real li

Description:

random number tables have many thousands of digits (0-9) all occurring in ... what would be the ratio of births of girls to births of boys? ... – PowerPoint PPT presentation

Number of Views:40
Avg rating:3.0/5.0
Slides: 3
Provided by: frie9
Category:

less

Transcript and Presenter's Notes

Title: Simulation allows us to perform experiments without actually having to do the experiments in real li


1
  • Simulation allows us to perform experiments
    without actually having to do the experiments in
    real life...this is done through the use of
    random numbers either generated from a random
    number table or from a computer program (such as
    R).
  • random number tables have many thousands of
    digits (0-9) all occurring in approximately equal
    numbers in the table thus when choosing a digit
    at random it can be done with the uniform
    distribution (Prob(any one digit is chosen).1 )
    Then these digits can be used to simulate other
    distributions like the Bernoulli, binomial, etc.
  • try some examples
  • simulate the toss of a fair coin once 5 times
    etc.
  • simulate a B(5,.5) r.v. (see the bottom of p.139
    for a better way)
  • one son policy in a country can we simulate
    it to answer what would be the average number
    of children in a family? what would be the ratio
    of births of girls to births of boys?
  • show the same methods in R using the r
    functions...

2
  • HW Read section and try 4.77 and 4.78. Notice
    that 4.77 asks you to simulate 120 rolls of a
    balanced die. Using the random number table is a
    possibility, but lets try R also... try the
    following code
  • the sample function allows you to randomly
    sample from
  • a set of numbers with equal probability assigned
    to each
  • number. thus in the line below we get a sample
    of 100
  • of the digits 1-6, replaceT making sure of
    equal probs.
  • xlt-sample(c(1,2,3,4,5,6),100, replaceT)
  • table(x)
  • the table function gives a frequency
    distribution of the
  • vector x in this case shows how many 1s, 2s,
    etc.
  • were randomly selected. to handle the example on
    p.140
  • create a vector of probs to go with the vector
    of values
  • prvectlt-c(.082,.205,.256,.214,.134,.067,.028,.01,.
    003,.001)
  • ylt-c(09)
  • xlt-sample(y,size100,replaceT,probprvect)
Write a Comment
User Comments (0)
About PowerShow.com