Created
March 14, 2016 18:17
-
-
Save adpoe/451692edd33c81799a52 to your computer and use it in GitHub Desktop.
Geometric Distribution for Carry On Items in Airport Simulation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def gen_number_of_carry_on_items__for_COMMUTER_passenger(): | |
""" | |
Number of bags a passenger carries is determined using a GEOMETRIC DISTIBUTION | |
BERNOULLI TRIAL with success bias %p = chance of passenger bringing bags | |
Bernoulli with 80% chance | |
P = 0.80 for international | |
:return: Number of bags a commuter passenger has carried on | |
""" | |
# Count number of iterations until a success | |
counter = 0 | |
successful_trial = 0 | |
while successful_trial == 0: | |
successful_trial = bernoulli_trial_commuter() | |
counter += 1 | |
return counter |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment