Resources

Modeling Scenario

1-001c-PopulationDecayThenSome-ModelingScenario

Author(s): Dina Yagodich

Frederick Community College, Frederick MD USA

Keywords: simulation occupancy population hotel

216 total view(s), 97 download(s)

Abstract

Resource Image You will be modeling the following situation: 100 people are in a hotel. Each day, each person has a random chance of 50% of leaving the hotel. No new people enter the hotel.

Citation

Researchers should cite this work as follows:

Article Context

Description

Before you run the simulation in MATLAB, answer the following questions:

•    How many people do you think will be left if you ran this experiment an infinite number of times?  Call this the Steady State solution.  

•    How many days do you think it will take to get to the steady state solution? 

Create MATLAB code to simulate the number of guests remaining each day until you get to the steady state solution. 

  • Use a while command around a command that uses randi([0:1], [N,1]).
  • N stands for the guests currently in the hotel.  A result of 0 indicates the guest leaving the hotel and 1 indicates the guest staying in the hotel. 
  • You will need to keep track of the population at the end of each day in a separate array.
  • Graph the number of people in the hotel at the beginning of each day as a scatter plot in MATLAB. 

 

Article Files

Authors

Author(s): Dina Yagodich

Frederick Community College, Frederick MD USA

Comments

Comments

There are no comments on this resource.