Skip to content

Commit

Permalink
Merge pull request #16 from arnaldoperez/main
Browse files Browse the repository at this point in the history
Traduccion a español del problems
  • Loading branch information
alesanchezr authored Jan 22, 2024
2 parents 2c7bc01 + a1ca03e commit c222f65
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions notebook/problems.es.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"cells":[{"cell_type":"markdown","id":"a41f3622","metadata":{},"source":["# Ejercicios de probabilidad"]},{"cell_type":"markdown","id":"a6bdbd89","metadata":{},"source":["## Ejercicio 1 \n","\n","Dos dados se lanzan una vez y se observa el total obtenido. Usa una simulación para encontrar la probabilidad estimada de que la puntuación sea mayor a 7 o un número par. Una simulación es una repetición del mismo experimento multiples veces para observar su comportamiento:\n","\n","- Ejecuta el experimento 1000 veces (lanza 2 dados 1000 veces, y suma el número de ambos dados).\n","- Lleva ua cuenta de los números y las veces que la suma fue mayor a 7 o un número par.\n","- Divide el número del paso 2 entre el número de iteraciones(1000)."]},{"cell_type":"code","execution_count":1,"id":"8939d892","metadata":{},"outputs":[],"source":["# TODO"]},{"cell_type":"markdown","id":"55732bca","metadata":{},"source":["## Ejercicio 2\n","\n","Una caja contiene 10 bolas blancas, 20 bolas rojas y 30 bolas verdes. Si tomamos 5 bolas de la caja reemplazándolas (tomando una bola, anotando el color y luego regresandola a la caja). Queremos saber la probabilidad de:\n","\n","1. Tomar 3 blancas y 2 rojas.\n","2. Toas todas del mismo color.\n","\n","Ejecuta el experimento 1000 veces y calcula las probabilidades que mencionadas."]},{"cell_type":"code","execution_count":null,"id":"23244d20","metadata":{},"outputs":[{"ename":"","evalue":"","output_type":"error","traceback":["\u001b[1;31mRunning cells with 'c:\\Program Files\\Python312\\python.exe' requires the ipykernel package.\n","\u001b[1;31mRun the following command to install 'ipykernel' into the Python environment. \n","\u001b[1;31mCommand: '\"c:/Program Files/Python312/python.exe\" -m pip install ipykernel -U --user --force-reinstall'"]}],"source":["ball_box = {}\n","\n","# Crea la cajas con las bolas\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.12.1"}},"nbformat":4,"nbformat_minor":5}
2 changes: 1 addition & 1 deletion notebook/problems.ipynb
Original file line number Diff line number Diff line change
@@ -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. All are 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 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}

0 comments on commit c222f65

Please sign in to comment.