Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- import random
- import itertools
- def comb(n,r):
- 'calcula el numero combinatorio de N tomados de R'
- return math.factorial(n) / (math.factorial(n-r) * math.factorial(r))
- nro_cartones = int(raw_input("Ingrese el nro de cartones aprox."))
- nros_serie = 16
- while comb(nros_serie, 15)<nro_cartones:
- nros_serie+=1
- #elegimos los numeros que pertencen a la serie
- numeros = random.sample(xrange(1,91),nros_serie)
- #armamos los cartones
- cartones = itertools.combinations(numeros,15)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement