From ab382bd962cb8c32707eb6a5767882e8459cc137 Mon Sep 17 00:00:00 2001 From: isabellegaldau <148903629+isabellegaldau@users.noreply.github.com> Date: Mon, 12 Feb 2024 19:43:33 -0500 Subject: [PATCH] spelling/grammar mistake problems.ipynb changed word 'dices' to 'dice' which is the correct plural :) --- notebook/problems.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notebook/problems.ipynb b/notebook/problems.ipynb index 2b18600..f167f1c 100644 --- a/notebook/problems.ipynb +++ b/notebook/problems.ipynb @@ -1 +1 @@ -{"cells":[{"cell_type":"markdown","id":"a41f3622","metadata":{},"source":["# Probability exercises"]},{"cell_type":"markdown","id":"a6bdbd89","metadata":{},"source":["## Exercise 1 \n","\n","Two dices are thrown once and the total score is observed. Use a simulation to find the estimated probability that the total score is even or greater than 7. A simulation is a repetition of the same experiment multiple times to observe its behavior:\n","\n","- Run the experiment 1000 times (roll 2 dice 1000 times, and sum the number of both dices).\n","- Keep track of the number of times that the sum was either greater than 7 or an even number.\n","- Divide the number from step 2 by the number of iterations (1000)."]},{"cell_type":"code","execution_count":1,"id":"8939d892","metadata":{},"outputs":[],"source":["# TODO"]},{"cell_type":"markdown","id":"55732bca","metadata":{},"source":["## Exercise 2\n","\n","A box contains 10 white balls, 20 red balls and 30 green balls. If we take 5 balls from the box with replacement (we take the ball, observe what color it is and put it back into the box). We want to know the probability of:\n","\n","1. Take 3 white and 2 red.\n","2. Take all of the same color.\n","\n","Run the experiment 1000 times and calculate the above probabilities."]},{"cell_type":"code","execution_count":2,"id":"23244d20","metadata":{},"outputs":[{"name":"stdout","output_type":"stream","text":["{0: 'White', 1: 'White', 2: 'White', 3: 'White', 4: 'White', 5: 'White', 6: 'White', 7: 'White', 8: 'White', 9: 'White', 10: 'Red', 11: 'Red', 12: 'Red', 13: 'Red', 14: 'Red', 15: 'Red', 16: 'Red', 17: 'Red', 18: 'Red', 19: 'Red', 20: 'Red', 21: 'Red', 22: 'Red', 23: 'Red', 24: 'Red', 25: 'Red', 26: 'Red', 27: 'Red', 28: 'Red', 29: 'Red', 30: 'Green', 31: 'Green', 32: 'Green', 33: 'Green', 34: 'Green', 35: 'Green', 36: 'Green', 37: 'Green', 38: 'Green', 39: 'Green', 40: 'Green', 41: 'Green', 42: 'Green', 43: 'Green', 44: 'Green', 45: 'Green', 46: 'Green', 47: 'Green', 48: 'Green', 49: 'Green', 50: 'Green', 51: 'Green', 52: 'Green', 53: 'Green', 54: 'Green', 55: 'Green', 56: 'Green', 57: 'Green', 58: 'Green', 59: 'Green'}\n"]}],"source":["ball_box = {}\n","\n","# Create the box of balls\n","for i in range(60):\n"," if i < 10:\n"," ball_box[i] = \"White\"\n"," elif (i > 9) and (i < 30):\n"," ball_box[i] = \"Red\"\n"," else:\n"," ball_box[i] = \"Green\"\n","\n","print(ball_box)\n"," \n","# TODO"]}],"metadata":{"interpreter":{"hash":"9248718ffe6ce6938b217e69dbcc175ea21f4c6b28a317e96c05334edae734bb"},"kernelspec":{"display_name":"Python 3.9.12 ('ML-BOOTCAMP')","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.11.4"}},"nbformat":4,"nbformat_minor":5} +{"cells":[{"cell_type":"markdown","id":"a41f3622","metadata":{},"source":["# Probability exercises"]},{"cell_type":"markdown","id":"a6bdbd89","metadata":{},"source":["## Exercise 1 \n","\n","Two dice are thrown once and the total score is observed. Use a simulation to find the estimated probability that the total score is even or greater than 7. A simulation is a repetition of the same experiment multiple times to observe its behavior:\n","\n","- Run the experiment 1000 times (roll 2 dice 1000 times, and sum the number of both dices).\n","- Keep track of the number of times that the sum was either greater than 7 or an even number.\n","- Divide the number from step 2 by the number of iterations (1000)."]},{"cell_type":"code","execution_count":1,"id":"8939d892","metadata":{},"outputs":[],"source":["# TODO"]},{"cell_type":"markdown","id":"55732bca","metadata":{},"source":["## Exercise 2\n","\n","A box contains 10 white balls, 20 red balls and 30 green balls. If we take 5 balls from the box with replacement (we take the ball, observe what color it is and put it back into the box). We want to know the probability of:\n","\n","1. Take 3 white and 2 red.\n","2. Take all of the same color.\n","\n","Run the experiment 1000 times and calculate the above probabilities."]},{"cell_type":"code","execution_count":2,"id":"23244d20","metadata":{},"outputs":[{"name":"stdout","output_type":"stream","text":["{0: 'White', 1: 'White', 2: 'White', 3: 'White', 4: 'White', 5: 'White', 6: 'White', 7: 'White', 8: 'White', 9: 'White', 10: 'Red', 11: 'Red', 12: 'Red', 13: 'Red', 14: 'Red', 15: 'Red', 16: 'Red', 17: 'Red', 18: 'Red', 19: 'Red', 20: 'Red', 21: 'Red', 22: 'Red', 23: 'Red', 24: 'Red', 25: 'Red', 26: 'Red', 27: 'Red', 28: 'Red', 29: 'Red', 30: 'Green', 31: 'Green', 32: 'Green', 33: 'Green', 34: 'Green', 35: 'Green', 36: 'Green', 37: 'Green', 38: 'Green', 39: 'Green', 40: 'Green', 41: 'Green', 42: 'Green', 43: 'Green', 44: 'Green', 45: 'Green', 46: 'Green', 47: 'Green', 48: 'Green', 49: 'Green', 50: 'Green', 51: 'Green', 52: 'Green', 53: 'Green', 54: 'Green', 55: 'Green', 56: 'Green', 57: 'Green', 58: 'Green', 59: 'Green'}\n"]}],"source":["ball_box = {}\n","\n","# Create the box of balls\n","for i in range(60):\n"," if i < 10:\n"," ball_box[i] = \"White\"\n"," elif (i > 9) and (i < 30):\n"," ball_box[i] = \"Red\"\n"," else:\n"," ball_box[i] = \"Green\"\n","\n","print(ball_box)\n"," \n","# TODO"]}],"metadata":{"interpreter":{"hash":"9248718ffe6ce6938b217e69dbcc175ea21f4c6b28a317e96c05334edae734bb"},"kernelspec":{"display_name":"Python 3.9.12 ('ML-BOOTCAMP')","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.11.4"}},"nbformat":4,"nbformat_minor":5}