Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def factorial(k):
- if k==0:
- return 1
- if k==1:
- return 1
- return k*factorial((k-1))
- #k-то что сверху а снизу
- def cIznPoK(k,n):
- return int(factorial(n)/factorial(k)*factorial(n-k))
- comb1=cIznPoK(2,6)*(cIznPoK(2,2)*cIznPoK(1,4)**2+2*cIznPoK(2,3)*cIznPoK(1,4)**2+2*cIznPoK(3,4)*cIznPoK(1,4))
- comb2=cIznPoK(1,2)*cIznPoK(1,6)*(cIznPoK(2,2)*cIznPoK(1,3)*cIznPoK(1,4)+2*cIznPoK(2,3)*cIznPoK(1,3)*cIznPoK(1,4)+cIznPoK(3,3)*cIznPoK(1,4)+cIznPoK(3,4)*cIznPoK(1,3))
- comb3=cIznPoK(1,6)*(cIznPoK(2,2)*cIznPoK(1,2)*cIznPoK(1,4)+2*cIznPoK(2,3)*cIznPoK(1,2)*cIznPoK(1,4)+cIznPoK(3,4)*cIznPoK(1,2))
- comb4=cIznPoK(1,2)*(cIznPoK(2,2)*cIznPoK(1,3)*cIznPoK(1,2)+2*cIznPoK(2,3)*cIznPoK(1,3)*cIznPoK(1,2)+cIznPoK(3,3)*cIznPoK(1,2))
- comb5=cIznPoK(2,2)*(cIznPoK(2,2)*cIznPoK(1,3)**2+2*cIznPoK(2,3)*cIznPoK(1,3)**2+2*cIznPoK(3,3)*cIznPoK(1,3))
- total=comb1+comb2+comb3+comb4+comb5
- alli=cIznPoK(4,44)
- print('all is= '+str(alli))
- print("1 is= "+str(comb1))
- print("2 is= "+str(comb2))
- print("3 is= "+str(comb2))
- print("4 is= "+str(comb2))
- print("5 is= "+str(comb2))
- print("total is ="+str(total))
- print('total/all= '+str(total/alli))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement