Results 1 to 3 of 3

Math Help - Simulation

  1. #1
    Junior Member
    Joined
    Oct 2007
    Posts
    52

    Simulation

    Hi
    The following is a practise test I am doing:

    John is collecting a set of 4 Native Birds cards, from Oatie Flakes cereal packets.
    The manufacturers of Oatie Flakes found that some of their machines malfunctioned and 20% of the packets of cereal contain 2 Native Birds cards instead of 1 card.

    1. Design a simulation to predict the number of packets of Oatie Flakes that are required to obtain a full set of Native Birds cards.
    Describe the simulation in sufficient detail so that another person could repeat it without your help.

    Does anyone have any thoughts as to how I should do it?
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by Paulo1913 View Post
    Hi
    The following is a practise test I am doing:

    John is collecting a set of 4 Native Birds cards, from Oatie Flakes cereal packets.
    The manufacturers of Oatie Flakes found that some of their machines malfunctioned and 20% of the packets of cereal contain 2 Native Birds cards instead of 1 card.

    1. Design a simulation to predict the number of packets of Oatie Flakes that are required to obtain a full set of Native Birds cards.
    Describe the simulation in sufficient detail so that another person could repeat it without your help.

    Does anyone have any thoughts as to how I should do it?
    Something like the following will give you an array containing a sample of the number of boxes needed to obtain a full set

    Code:
    Ncases=100
    outputs=zeros(1,Ncases)
     
    for idx=1 to Ncases
       outputs(idx)=Npackets
    end
     
    //======================
     
    function Npackets
      nn=0   //number of distinct cards held
      cards=zeros(1,4)  //array with 1's for held cards 0's otherwise
      while nn<4   // loop untill full set held
         xx=random;
         card=RandomInteger(1,4)  //first card in packet
         cards(card)=1
         if xx<0.2
           card=RandomInteger(1,4)  //second card if present
           cards(card)=1
         end
         nn=sum(cards)  //total number of distinct cards
      end
      return nn
    endfunction
    RonL
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Junior Member
    Joined
    Oct 2007
    Posts
    52
    Sorry but I don't understand that. Could you please transfer that into words?

    Or if anyone else can think of something please let me know
    Last edited by Paulo1913; July 30th 2008 at 12:37 AM.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Simulation
    Posted in the Statistics Forum
    Replies: 1
    Last Post: March 6th 2010, 09:47 AM
  2. Simulation help
    Posted in the Math Software Forum
    Replies: 0
    Last Post: February 11th 2010, 07:16 PM
  3. Simulation
    Posted in the Advanced Statistics Forum
    Replies: 3
    Last Post: January 17th 2010, 07:47 PM
  4. Replies: 0
    Last Post: December 15th 2009, 01:24 AM
  5. SImulation Help!!!!!!!!!!!!!!!!!!!
    Posted in the Statistics Forum
    Replies: 1
    Last Post: August 31st 2008, 03:20 AM

Search Tags


/mathhelpforum @mathhelpforum