Que J3 no tenga la piedra que juegue J2 y deba pegarle al salidor

Escenario

Sale jugador 1 con un doble, jugador 2 juega una piedra y jugador 3 debe pegarle obligatoriamente al salidor (su compañero) por no tener el palo jugado por J2


Resultados

De 168 simulaciones, donde el jugador uno tiene doble X, el jugador dos tiene X-N, y el jugador tres no tiene N pero sí tiene al menos una X, ocurrió: 47 veces (27.97%).


¿Lo anterior te pasa seguido?




Aquí te dejo el extracto de código

combined_condition_counts_specific_p3 = {}

# Iterate through all possible pairs of distinct numbers (X, N)
for X in range(7):
for N in range(7):
if X == N: # Ensure X is distinct from N
continue

count_current_condition = 0

# Iterate through each simulation
for simulation_hands in all_simulations_player_hands:
p1_hand = simulation_hands[0] # Player One's hand
p2_hand = simulation_hands[1] # Player Two's hand
p3_hand = simulation_hands[2] # Player Three's hand

# Check the three conditions
p1_has_double_X = has_double_in_hand(p1_hand, X)
p2_has_X_N_piece = has_piece_in_hand(p2_hand, X, N)
p3_does_not_have_N = count_number_in_hand(p3_hand, N) == 0
p3_has_at_least_one_X = count_number_in_hand(p3_hand, X) > 0

# If all three conditions are met, increment the counter
if p1_has_double_X and p2_has_X_N_piece and p3_does_not_have_N and p3_has_at_least_one_X:
count_current_condition += 1

# Store the count for the current pair (X, N)
combined_condition_counts_specific_p3[(X, N)] = count_current_condition

print("Conteo de condiciones combinadas para cada par (X, N):")
for pair, count in combined_condition_counts_specific_p3.items():
print(f" Par (X={pair[0]}, N={pair[1]}): {count} veces")

Comments