Probabilidad de tener 3 dobles al pelo
Escenario
¿Probabilidad de tener 3 dobles al pelo?
Resultado
Luego de correr 168 veces la simulación con el escenario indicado no trajo resultados, se volvió a correr y ningún resultado. Por segunda vez en este blog se decidió correr esta simulación 1680 veces.
De 1680 veces sola 1 trajo cumplió con este escenario (0,05%)
¿Crees que te ha pasado más?
Aquí el código de python
player_one_three_doubles_al_pelo_count = 0
# Iterate through each simulation
for simulation_hands in all_simulations_player_hands:
p1_hand = simulation_hands[0] # Player One's hand
doubles_in_hand = []
for piece in p1_hand:
if piece[0] == piece[1]:
doubles_in_hand.append(piece[0]) # Store the value of the double
# Check if Player One has exactly three doubles
if len(doubles_in_hand) == 3:
all_three_doubles_al_pelo = True
for double_value in doubles_in_hand:
# A double (X,X) is 'al pelo' if the number X appears exactly twice in the hand (only the double piece itself).
if count_number_in_hand(p1_hand, double_value) != 2:
all_three_doubles_al_pelo = False
break # No need to check further if one is not 'al pelo'
if all_three_doubles_al_pelo:
player_one_three_doubles_al_pelo_count += 1
print(f"\nNúmero total de veces que el Jugador Uno tuvo exactamente tres dobles y los tres estaban 'al pelo' (en {num_simulations} simulaciones): {player_one_three_doubles_al_pelo_count}")
Comments
Post a Comment