Si reparte 13 cartas de un mazo normal, ¿cuál es la probabilidad de que se arreglen todos los palos?

Su pregunta necesita aclaración: ¿CUÁNTOS de cada traje desea (y desea que cada traje esté incluido)?

Tienes una respuesta de caso general perfecta de Justin Rising . Si desea ser específico, necesitamos la información anterior.

Por ejemplo: 3 tréboles, 3 diamantes, 3 corazones, 4 espadas –

Hay 52 cartas en una baraja; 13 en cada palo. Cada carta que selecciones (sin reemplazo) reduce la cantidad de cartas en el mazo. Por lo tanto, la probabilidad de sacar 3 palos seguidos es: 13/52 * 12/51 * 11/50.

Ahora quedan 49 cartas en el mazo. La probabilidad de sacar 3 diamantes seguidos es ahora: 13/49 * 12/48 * 11/47.

Continuemos. La probabilidad de sacar 3 corazones de las cartas restantes será: 13/46 * 12/45 * 11/44.

Y finalmente, las 4 espadas: 13/43 * 12/42 * 11/41 * 10/40.

Multiplique todas estas respuestas para obtener su respuesta final … que es “bastante pequeña”.

Obviamente, la probabilidad sería diferente para una elección diferente de cartas.

La respuesta práctica es: si esto sucede al jugar Bridge duplicado, la mesa anterior no pudo barajar sus cartas (como se supone que deben hacerlo) antes de devolverlas al tablero. Esto sucede a veces cuando la mano no ha recibido ofertas y ha sido “pasada”: algunas personas, incorrectamente, simplemente devuelven sus manos ordenadas al tablero.

Para calcular las probabilidades pequeñas reales, necesitamos calcular la siguiente expresión:

[matemáticas] \ sum_P \ left [\ binom {13} {s} \ binom {13} {h} \ binom {13} {d} \ binom {13} {c} \ right] / \ binom {52} { 13} [/ matemáticas]

donde [matemática] P [/ matemática] es el conjunto de particiones de 13 cartas con [matemática] s [/ matemática] Picas, [matemática] h [/ matemática] Corazones, [matemática] d [/ matemática] Diamantes y [ matemáticas] c [/ matemáticas] Clubes.

Este es un cálculo desordenado que las computadoras hacen mejor. Lo dejaré a los matemáticos aplicados y a los informáticos 🙂

Este es el nivel en el que configurar los problemas de combinatoria se vuelve difícil para mí (especialmente porque no estoy practicando). No podía asegurar con certeza que Justin Rising estaba calculando el valor correcto, así que simulé 10,000,000 de manos … Obtuve [matemáticas] 6.56 \ veces 10 ^ {- 5} [/ matemáticas]. Bien hecho, Justin.

Aquí está mi código organizado pero (estoy seguro) ineficiente:

import random
import time def deal():
deck = ['h','c','s','d']*13
random.shuffle(deck)
hand = [] while len(hand) < 13:
hand.append(deck.pop())
return hand def checksuits(hand):
global suitlist if len(hand) == 1:
return "Sorted" suit1 = hand[0]
suit2 = hand[1] if suit2 != suit1:
if suit2 in suitlist:
return "Not sorted"
if suit2 not in suitlist:
suitlist.append(suit1)
return checksuits(hand[1:]) if suit2 == suit1:
return checksuits(hand[1:]) t0 = time.time()
results = [] # 100 million
for i in range(1,100000001):
suitlist = []
results.append(checksuits(deal())) t1 = time.time()
total = t1-t0
print total
# takes 20 minutes with 10 million simulations (and takes 2 minutes with 1 million) # See how it worked out
sum(x == "Sorted" for x in results)
# 6556 out of 10,000,000, or...
# P = 6.556*10E-5

import random
import time def deal():
deck = ['h','c','s','d']*13
random.shuffle(deck)
hand = [] while len(hand) < 13:
hand.append(deck.pop())
return hand def checksuits(hand):
global suitlist if len(hand) == 1:
return "Sorted" suit1 = hand[0]
suit2 = hand[1] if suit2 != suit1:
if suit2 in suitlist:
return "Not sorted"
if suit2 not in suitlist:
suitlist.append(suit1)
return checksuits(hand[1:]) if suit2 == suit1:
return checksuits(hand[1:]) t0 = time.time()
results = [] # 100 million
for i in range(1,100000001):
suitlist = []
results.append(checksuits(deal())) t1 = time.time()
total = t1-t0
print total
# takes 20 minutes with 10 million simulations (and takes 2 minutes with 1 million) # See how it worked out
sum(x == "Sorted" for x in results)
# 6556 out of 10,000,000, or...
# P = 6.556*10E-5

import random
import time def deal():
deck = ['h','c','s','d']*13
random.shuffle(deck)
hand = [] while len(hand) < 13:
hand.append(deck.pop())
return hand def checksuits(hand):
global suitlist if len(hand) == 1:
return "Sorted" suit1 = hand[0]
suit2 = hand[1] if suit2 != suit1:
if suit2 in suitlist:
return "Not sorted"
if suit2 not in suitlist:
suitlist.append(suit1)
return checksuits(hand[1:]) if suit2 == suit1:
return checksuits(hand[1:]) t0 = time.time()
results = [] # 100 million
for i in range(1,100000001):
suitlist = []
results.append(checksuits(deal())) t1 = time.time()
total = t1-t0
print total
# takes 20 minutes with 10 million simulations (and takes 2 minutes with 1 million) # See how it worked out
sum(x == "Sorted" for x in results)
# 6556 out of 10,000,000, or...
# P = 6.556*10E-5

import random
import time def deal():
deck = ['h','c','s','d']*13
random.shuffle(deck)
hand = [] while len(hand) < 13:
hand.append(deck.pop())
return hand def checksuits(hand):
global suitlist if len(hand) == 1:
return "Sorted" suit1 = hand[0]
suit2 = hand[1] if suit2 != suit1:
if suit2 in suitlist:
return "Not sorted"
if suit2 not in suitlist:
suitlist.append(suit1)
return checksuits(hand[1:]) if suit2 == suit1:
return checksuits(hand[1:]) t0 = time.time()
results = [] # 100 million
for i in range(1,100000001):
suitlist = []
results.append(checksuits(deal())) t1 = time.time()
total = t1-t0
print total
# takes 20 minutes with 10 million simulations (and takes 2 minutes with 1 million) # See how it worked out
sum(x == "Sorted" for x in results)
# 6556 out of 10,000,000, or...
# P = 6.556*10E-5

import random
import time def deal():
deck = ['h','c','s','d']*13
random.shuffle(deck)
hand = [] while len(hand) < 13:
hand.append(deck.pop())
return hand def checksuits(hand):
global suitlist if len(hand) == 1:
return "Sorted" suit1 = hand[0]
suit2 = hand[1] if suit2 != suit1:
if suit2 in suitlist:
return "Not sorted"
if suit2 not in suitlist:
suitlist.append(suit1)
return checksuits(hand[1:]) if suit2 == suit1:
return checksuits(hand[1:]) t0 = time.time()
results = [] # 100 million
for i in range(1,100000001):
suitlist = []
results.append(checksuits(deal())) t1 = time.time()
total = t1-t0
print total
# takes 20 minutes with 10 million simulations (and takes 2 minutes with 1 million) # See how it worked out
sum(x == "Sorted" for x in results)
# 6556 out of 10,000,000, or...
# P = 6.556*10E-5

import random
import time def deal():
deck = ['h','c','s','d']*13
random.shuffle(deck)
hand = [] while len(hand) < 13:
hand.append(deck.pop())
return hand def checksuits(hand):
global suitlist if len(hand) == 1:
return "Sorted" suit1 = hand[0]
suit2 = hand[1] if suit2 != suit1:
if suit2 in suitlist:
return "Not sorted"
if suit2 not in suitlist:
suitlist.append(suit1)
return checksuits(hand[1:]) if suit2 == suit1:
return checksuits(hand[1:]) t0 = time.time()
results = [] # 100 million
for i in range(1,100000001):
suitlist = []
results.append(checksuits(deal())) t1 = time.time()
total = t1-t0
print total
# takes 20 minutes with 10 million simulations (and takes 2 minutes with 1 million) # See how it worked out
sum(x == "Sorted" for x in results)
# 6556 out of 10,000,000, or...
# P = 6.556*10E-5

import random
import time def deal():
deck = ['h','c','s','d']*13
random.shuffle(deck)
hand = [] while len(hand) < 13:
hand.append(deck.pop())
return hand def checksuits(hand):
global suitlist if len(hand) == 1:
return "Sorted" suit1 = hand[0]
suit2 = hand[1] if suit2 != suit1:
if suit2 in suitlist:
return "Not sorted"
if suit2 not in suitlist:
suitlist.append(suit1)
return checksuits(hand[1:]) if suit2 == suit1:
return checksuits(hand[1:]) t0 = time.time()
results = [] # 100 million
for i in range(1,100000001):
suitlist = []
results.append(checksuits(deal())) t1 = time.time()
total = t1-t0
print total
# takes 20 minutes with 10 million simulations (and takes 2 minutes with 1 million) # See how it worked out
sum(x == "Sorted" for x in results)
# 6556 out of 10,000,000, or...
# P = 6.556*10E-5

import random
import time def deal():
deck = ['h','c','s','d']*13
random.shuffle(deck)
hand = [] while len(hand) < 13:
hand.append(deck.pop())
return hand def checksuits(hand):
global suitlist if len(hand) == 1:
return "Sorted" suit1 = hand[0]
suit2 = hand[1] if suit2 != suit1:
if suit2 in suitlist:
return "Not sorted"
if suit2 not in suitlist:
suitlist.append(suit1)
return checksuits(hand[1:]) if suit2 == suit1:
return checksuits(hand[1:]) t0 = time.time()
results = [] # 100 million
for i in range(1,100000001):
suitlist = []
results.append(checksuits(deal())) t1 = time.time()
total = t1-t0
print total
# takes 20 minutes with 10 million simulations (and takes 2 minutes with 1 million) # See how it worked out
sum(x == "Sorted" for x in results)
# 6556 out of 10,000,000, or...
# P = 6.556*10E-5

import random
import time def deal():
deck = ['h','c','s','d']*13
random.shuffle(deck)
hand = [] while len(hand) < 13:
hand.append(deck.pop())
return hand def checksuits(hand):
global suitlist if len(hand) == 1:
return "Sorted" suit1 = hand[0]
suit2 = hand[1] if suit2 != suit1:
if suit2 in suitlist:
return "Not sorted"
if suit2 not in suitlist:
suitlist.append(suit1)
return checksuits(hand[1:]) if suit2 == suit1:
return checksuits(hand[1:]) t0 = time.time()
results = [] # 100 million
for i in range(1,100000001):
suitlist = []
results.append(checksuits(deal())) t1 = time.time()
total = t1-t0
print total
# takes 20 minutes with 10 million simulations (and takes 2 minutes with 1 million) # See how it worked out
sum(x == "Sorted" for x in results)
# 6556 out of 10,000,000, or...
# P = 6.556*10E-5

import random
import time def deal():
deck = ['h','c','s','d']*13
random.shuffle(deck)
hand = [] while len(hand) < 13:
hand.append(deck.pop())
return hand def checksuits(hand):
global suitlist if len(hand) == 1:
return "Sorted" suit1 = hand[0]
suit2 = hand[1] if suit2 != suit1:
if suit2 in suitlist:
return "Not sorted"
if suit2 not in suitlist:
suitlist.append(suit1)
return checksuits(hand[1:]) if suit2 == suit1:
return checksuits(hand[1:]) t0 = time.time()
results = [] # 100 million
for i in range(1,100000001):
suitlist = []
results.append(checksuits(deal())) t1 = time.time()
total = t1-t0
print total
# takes 20 minutes with 10 million simulations (and takes 2 minutes with 1 million) # See how it worked out
sum(x == "Sorted" for x in results)
# 6556 out of 10,000,000, or...
# P = 6.556*10E-5

import random
import time def deal():
deck = ['h','c','s','d']*13
random.shuffle(deck)
hand = [] while len(hand) < 13:
hand.append(deck.pop())
return hand def checksuits(hand):
global suitlist if len(hand) == 1:
return "Sorted" suit1 = hand[0]
suit2 = hand[1] if suit2 != suit1:
if suit2 in suitlist:
return "Not sorted"
if suit2 not in suitlist:
suitlist.append(suit1)
return checksuits(hand[1:]) if suit2 == suit1:
return checksuits(hand[1:]) t0 = time.time()
results = [] # 100 million
for i in range(1,100000001):
suitlist = []
results.append(checksuits(deal())) t1 = time.time()
total = t1-t0
print total
# takes 20 minutes with 10 million simulations (and takes 2 minutes with 1 million) # See how it worked out
sum(x == "Sorted" for x in results)
# 6556 out of 10,000,000, or...
# P = 6.556*10E-5

import random
import time def deal():
deck = ['h','c','s','d']*13
random.shuffle(deck)
hand = [] while len(hand) < 13:
hand.append(deck.pop())
return hand def checksuits(hand):
global suitlist if len(hand) == 1:
return "Sorted" suit1 = hand[0]
suit2 = hand[1] if suit2 != suit1:
if suit2 in suitlist:
return "Not sorted"
if suit2 not in suitlist:
suitlist.append(suit1)
return checksuits(hand[1:]) if suit2 == suit1:
return checksuits(hand[1:]) t0 = time.time()
results = [] # 100 million
for i in range(1,100000001):
suitlist = []
results.append(checksuits(deal())) t1 = time.time()
total = t1-t0
print total
# takes 20 minutes with 10 million simulations (and takes 2 minutes with 1 million) # See how it worked out
sum(x == "Sorted" for x in results)
# 6556 out of 10,000,000, or...
# P = 6.556*10E-5

La forma más fácil de hacer esto es condicionar el número de cartas en cada palo. Si tiene clubes [matemática] c [/ matemática], [matemática] d [/ matemática], corazones [matemática] h [/ matemática] y espadas [matemática] s [/ matemática] y [matemática] n [/ matemáticas] distintos palos en tu mano, la probabilidad de que obtengas todas las cartas de cada palo juntas es
[matemáticas] \ frac {n! c! d! h! s!} {13!} [/ matemáticas]

La probabilidad de obtener [math] c [/ math] clubs, [math] d [/ math] diamantes, [math] h [/ math] corazones y [math] s [/ math] picas es simplemente
[matemáticas] \ frac {{13 \ elegir c} {13 \ elegir d} {13 \ elegir h} {13 \ elegir s}} {{52 \ elegir 13}} [/ matemática]

La probabilidad general viene dada por la suma del producto de estos dos valores sobre todos [matemática] c, d, h, s \ in \ {0, 1, 2, \ dots, 13 \} [/ math] tal que [matemáticas] c + d + h + s = 13 [/ matemáticas].

Eso no se puede hacer a mano, así que aquí está el código R:

combos <- expand.grid (0:13, 0:13, 0:13, 0:13)
idx <- aplicar (combos, 1, suma) == 13
combos <- combos [idx,]
f <- función (v) {prod (factorial (v)) * prod (elegir (13, v))}
g <- función (v) {sum (v> 0)}
p <- suma (factorial (aplicar (combos, 1, g)) / factorial (13) * aplicar (combos, 1, f) / elegir (52, 13)) Obtengo que [matemáticas] p \ aproximadamente 6.49 \ veces 10 ^ {- 5} [/ matemáticas], lo que parece un orden de magnitud razonable. Este no es un evento increíblemente probable.

Suponiendo que pregunte cuáles son las posibilidades de que reparta 13 cartas de un mazo normal, las 13 cartas serán del mismo palo, la respuesta es:

1 en 158,753,389,900

Reparte la primera carta. Esa carta tiene que ser un palo. La siguiente carta tiene una probabilidad de 12/51 de ser el mismo palo, ya que quedan 12 cartas de ese palo en el mazo de 51 cartas. Luego, para que la siguiente carta coincida, sería 11/50. Puede obtener la probabilidad general de la siguiente manera:
1 * 12/51 * 11/50 * 10/49 * 9/48 * 8/47 * 7/46 * 6/45 * 5/44 * 4/43 * 3/42 * 2/41 * 1/40

Esto se simplifica a 12! / (51! / 39!)