simple Combinatorics.

Revision en1, by theoneandonlytron, 2026-10-26 04:30:31

So this blog wouldnt contain any code, just pure math that I think might help with programming + I wouild recmmend knowing math because know good math allow you to save A LOT of code. + This is my blog to compile what I've learned, I hope that when you read this you would learn something.

  • Theory:
  • definition n! = n * (n-1) * (n-2) * .... * 1
  • amount of ways to permute a sequence of n numbers is n!, this can be proven by fixing the first element which we can take n element as the first element, then it would be a sub problem, permutating n-1 elemnts, so we get n! = (n-1)! * n -> we have proven for all n
  • amount of ways to permute k elements out of n elements is (n!/ (n — k)!), this is simple because we can use the same proof as n!, but we have and ending at n — k.
  • amount of ways to of picking k elements out of n elements where order doesen't matter is (n! / (n-k)!k!), this is simple, we continue from permutating k elements out of n elements, and then because the k element could be permutate in k! (first proof), we can just divide by k! so we fix the order without overcounting the permutations.
  • The amount of ways to permute a sequence of duplicate elemnts is (n! / (c1! * c2! * c3!...)) where c stand for each character amount, why this work, for each subset of characters, we could permute then c1! ways, because its duplicate, all permutation the same so we want to divide by c1! so they dont count duplicates.

Problems: +

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en5 English theoneandonlytron 2026-10-29 04:49:46 177
en4 English theoneandonlytron 2026-10-29 04:46:49 14388 Tiny change: 'ent:\n\n$$ACx5BDx4x1x2x3ABx1CDx2x5x4x3\begin{mat' -> 'ent:\n\n$$\begin{mat' (published)
en3 English theoneandonlytron 2026-10-29 04:06:36 1169
en2 English theoneandonlytron 2026-10-26 04:47:18 1743
en1 English theoneandonlytron 2026-10-26 04:30:31 1501 Initial revision (saved to drafts)