-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
70 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
{ | ||
"nbformat": 4, | ||
"nbformat_minor": 0, | ||
"metadata": { | ||
"colab": { | ||
"provenance": [], | ||
"authorship_tag": "ABX9TyON4T1fKfYhh139sfcyWVAM", | ||
"include_colab_link": true | ||
}, | ||
"kernelspec": { | ||
"name": "python3", | ||
"display_name": "Python 3" | ||
}, | ||
"language_info": { | ||
"name": "python" | ||
} | ||
}, | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": { | ||
"id": "view-in-github", | ||
"colab_type": "text" | ||
}, | ||
"source": [ | ||
"<a href=\"https://colab.research.google.com/github/nurfnick/Operations_Research/blob/main/RandomizationAssignment.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"# Simulation Assignment\n", | ||
"\n" | ||
], | ||
"metadata": { | ||
"id": "OmPwLqs4wNbI" | ||
} | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"On exam 1, I proposed the problem of having 10 cases of water with 10 bottles in each case and 10 oz in each bottle. One case is known to be filled with one ounce less than all the other bottles. Jacob proposed a random selection method for finding the case with the bottles that have less water. Essentially he'll pull one bottle and test it. If it is 9 ounces, he has found the case that is short. Let's explore this random test.\n", | ||
"\n", | ||
"1. Write a random function call that returns 10 ounces 9 out of 10 times and 9 ounces one out of ten.\n", | ||
"\n", | ||
"2. What is the expected weight of a random pull?\n", | ||
"\n", | ||
"3. Test your expected weight by running a simulation drawing at least 100 bottles and taking the average of the wieghts. Does it agree with your theoretical result?\n", | ||
"\n", | ||
"4. We are particuarly interested in how many pulls would be required to find the case that was short. If you test one at a time, how many pulls do you expect before you find the case that is short?\n", | ||
"\n", | ||
"5. Create a function that creates a sequence of pulling bottles and stops when you find the bottle with 9 ounces. Test this function a bunch of times. Do you notice anything odd when comparing it to your previous result?\n", | ||
"\n", | ||
"6. Propose a modification to the coding you did in the first step that would improve the results. Hint: Consider a different data structure that would be more applicable to the real world case." | ||
], | ||
"metadata": { | ||
"id": "g83rw_zywSp1" | ||
} | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"id": "782zpNTjwKP5" | ||
}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
] | ||
} |