Anagrammi

Ricorda

Prova ad anagrammare delle parole producendo tutte le permutazioni possibili (anche se ottieni parole senza senso…)

amo P_{3}=3!=6 amo aom mao moa oam oma
ama P_{3;2}=\frac{3!}{2!}=\frac{3 \cdot 2 \cdot 1}{2 \cdot 1}=3 a1a2m a2a1m a1ma2 a2ma1 ma1a2 ma2a1
aam ama maa
aaa P_{3;3}=\frac{3!}{3!}=\frac{3 \cdot 2 \cdot 1}{3 \cdot 2 \cdot 1}=1 a1a2a3 a1a3a2 a2a1a3 a2a3a1 a3a1a2 a3a2a1
aaa
amor P_{4}=4!=24 amor amro aomr aorm armo arom maor maro moar mora mrao mroa oamr oarm omar omra oram orma ramo raom rmao rmoa roam roma
amar P_{4;2}=\frac{4!}{2!}=\frac{4 \cdot 3 \cdot 2 \cdot 1}{2 \cdot 1}=12 a1a2mr, a2a1mr, a1a2rm, a2a1rm, a1ma2r, a2ma1r, a1mra2, a2mra1, a1ra2m, a2ra1m, a1rma2, a2rma1, ma1a2r, ma2a1r, ma1ra2, ma2ra1, mra1a2, mra2a1, ra1a2m, ra2a1m, ra1ma2, ra2ma1, rma1a2, rma2a1
aamr aarm amar amra aram arma maar mara mraa raam rama rmaa
mama P_{4;2,2}=\frac{4!}{2!2!}=\frac{4 \cdot 3 \cdot 2 \cdot 1}{2 \cdot 1 \cdot 2 \cdot 1}=6 a1a2m1m2, a1a2m2m1, a2a1m1m2, a2a1m2m1, a1m1a2m2, a2ma1m, a1mma2, a2mma1, a1ma2m, a2ma1m, a1mma2, a2mma1, ma1a2m, ma2a1m, ma1ma2, ma2ma1, mma1a2, mma2a1, ma1a2m, ma2a1m, ma1ma2, ma2ma1, mma1a2, mma2a1
aamm, amam, amma, maam, mama, mmaa
amore P_{5}=5!=120 aemor, …, romea
amare P_{5;2}=\frac{5!}{2!}=\frac{5\cdot 4\cdot 3\cdot 2\cdot 1}{2 \cdot 1}=60 aaemr, …, rmeaa
amara P_{5;3}=\frac{5!}{3!}=\frac{5\cdot4\cdot3\cdot2\cdot1}{3 \cdot2 \cdot1}=20 aaamr, …, rmaaa
mamma P_{5;2,3}=\frac{5!}{2!3!}=\frac{5\cdot4\cdot3\cdot2\cdot1}{2\cdot 1 \cdot 3 \cdot2 \cdot1}=10 aammm, amamm, ammam, ammma, maamm, mamam, mamma, mmaam, mmama, mmmaa
remota P_{6}=6!=720 aemort, …, tromea
remora P_{6;2}=\frac{6!}{2!}=\frac{6\cdot 5\cdot 4\cdot 3\cdot 2\cdot 1}{2 \cdot1}=360 aemorr, …, rromea
remore P_{6;2,2}=\frac{6!}{2!2!}=\frac{6\cdot 5\cdot 4\cdot 3\cdot 2\cdot 1}{2 \cdot 1 \cdot 2 \cdot 1}=180 eemorr, …, rromee
errore P_{6;2,3}=\frac{6!}{2!3!}=\frac{6\cdot 5\cdot 4\cdot 3\cdot 2\cdot 1}{2 \cdot 1 \cdot 3\cdot 2 \cdot 1}=60 eeorrr, …, rrroee


Codifica: Python

Notice: This work is licensed under a BY-NC-SA. Permalink: Anagrammi

Comments are closed.