Hello,
Soll es eine dreidimensionale Permutation werden, also jede Anordnungsmöglichkeit jeder Menge mit jeder Anordnungsmöglichkeit der beiden anderen kombiniert werden?
Nein nur eine Richtung und Dimension,
array
(
array('a1', 'a2', 'a3'),
array('b1', 'b2'),
array('c1', 'c2', 'c3'),
array('d1', 'd2', 'd3', 'd4' )
)Permutation
a1 b1 c1 d1
a1 b1 c1 d2
a1 b1 c1 d3
a1 b1 c1 d4
a1 b1 c2 d1
a1 b1 c2 d2
a1 b1 c2 d3
a1 b1 c2 d4
a1 b1 c3 d1
a1 b1 c3 d2
a1 b1 c3 d3
a1 b1 c3 d4
a1 b2 c1 d1
a1 b2 c1 d2
a1 b2 c1 d3
a1 b2 c1 d4
a1 b2 c2 d1
a1 b2 c2 d2
a1 b2 c2 d3
a1 b2 c2 d4
a1 b2 c3 d1
a1 b2 c3 d2
a1 b2 c3 d3
a1 b2 c3 d4
Das ist aber nur eine vollständige hierarchische Kombination
Eine Permutation wäre es, wenn die Reihenfolge vertauscht wird und ggf. noch die Größe der Ergebnismengen variiert wird (variierte Permutation).
also aus 'a b c' dann
a b c
a c b
b c a
b a c
c a b
c b a
a b
b a
a c
c a
a c
c a
b c
c b
a
b
c
(habe ich eine vergessen?)
wird.
Liebe Grüße aus dem schönen Oberharz
Tom vom Berg