Binomial coefficients & Pascal's triangle
Në shqip: Koeficientët binomialë
ShpjegimiSQ
„n mbi k“ tregon në sa mënyra zgjedh k sende nga n. Trekëndëshi i Pascal-it i jep të gjitha: çdo numër është shuma e dy numrave sipër tij — një DP i bukur.
EnglishEN
“n choose k” is how many ways you can pick k items from n. Pascal's triangle gives them all: each number is the sum of the two above it — a beautiful DP.
Si ta mendosh
Si të numërosh sa ekipe 5-vetëshe mund të formosh nga klasa.
Lexoje në anglisht
Like counting how many 5-person teams you can form from the class.
Shembull kodipython
from math import comb
print(comb(30, 5)) # 142506