editing
approved
editing
approved
Math Mathematics Stack Exchange, <a href="http://math.stackexchange.com/questions/864116/how-to-count-different-card-combinations-with-isomorphism">Subsets of the standard deck of 52 cards under suit permutation isomorphisms</a>
approved
editing
reviewed
approved
proposed
reviewed
editing
proposed
Math Stack Exchange, <a href="http://math.stackexchange.com/questions/864116/how-to-count-different-card-combinations-with-isomorphism">Subsets of the standard deck of 52 cards under suit permutation isomorphisms</a>
proposed
editing
editing
proposed
Marko Riedel, <a href="/A245228/a245228.maple.txt">Maple program for sequence including cycle indices.</a>
with(combinat);
with(numtheory);
pet_flatten_term :=
proc(varp)
local terml, d, cf, v;
terml := [];
cf := varp;
for v in indets(varp) do
d := degree(varp, v);
terml := [op(terml), seq(v, k=1..d)];
cf := cf/v^d;
od;
[cf, terml];
end;
pet_autom2cycles :=
proc(src, aut)
local numa, numsubs;
local marks, pos, cycs, cpos, clen;
numsubs := [seq(src[k]=k, k=1..nops(src))];
numa := subs(numsubs, aut);
marks := [seq(true, pos=1..nops(aut))];
cycs := []; pos := 1;
while pos <= nops(aut) do
if marks[pos] then
clen := 0; cpos := pos;
while marks[cpos] do
marks[cpos] := false;
cpos := numa[cpos];
clen := clen+1;
od;
cycs := [op(cycs), clen];
fi;
pos := pos+1;
od;
return mul(a[cycs[k]], k=1..nops(cycs));
end;
pet_cycleind_symm :=
proc(n)
local p, s;
option remember;
if n=0 then return 1; fi;
expand(1/n*add(a[l]*pet_cycleind_symm(n-l), l=1..n));
end;
pet_cycleind_cards :=
proc()
option remember;
local cind, cards, p, q, perm, pcards;
cind := 0;
cards := [seq(seq([p, q], p=1..13), q=1..4)];
for perm in permute(4) do
pcards :=
[seq([cards[q][1], perm[cards[q][2]]], q=1..52)];
cind := cind + pet_autom2cycles(cards, pcards);
od;
cind/24;
end;
q :=
proc(N)
option remember;
local idx_slots, res, a, b,
flat_a, flat_b, cycs_a, cycs_b, q,
tbl_a, tbl_b, f1, f2, f3;
if N=1 then
idx_slots := [a[1]]
else
idx_slots := pet_cycleind_symm(N);
fi;
res := 0;
for a in idx_slots do
flat_a := pet_flatten_term(a);
cycs_a := sort(flat_a[2]);
tbl_a := table();
for q in convert(cycs_a, 'multiset') do
tbl_a[op(1, q[1])] := q[2];
od;
f1 := map(q -> op(1, q), cycs_a);
f1 := mul(f1[q], q=1..nops(cycs_a));
f2 := convert(map(q -> op(1, q), cycs_a), 'multiset');
f2 := map(q -> q[2], f2);
f2 := mul(f2[q]!, q=1..nops(f2));
for b in pet_cycleind_cards() do
flat_b := pet_flatten_term(b);
cycs_b := sort(flat_b[2]);
tbl_b := table();
for q in convert(cycs_b, 'multiset') do
tbl_b[op(1, q[1])] := q[2];
od;
f3 := 1;
for q in [indices(tbl_a, 'nolist')] do
if type(tbl_b[q], integer) then
f3 := f3*binomial(tbl_b[q], tbl_a[q]);
else
f3 := 0;
fi;
od;
res := res + f3*f2*f1*flat_a[1]*flat_b[1];
od;
od;
res;
end;
approved
editing
editing
approved
More than the usual number of terms are given in order to show the full sequence.
approved
editing