Tag Info

Hot answers tagged

2

Your operation using the v10 operator form for MemberQ, along with Alternatives: uno = RandomSample[Range @ 52] ~Partition~ 13; And @@ MemberQ[1 | 14 | 27 | 40] /@ uno Or using modular arithmetic as already provided by others: x = RandomSample @ Range @ 52; Sign[x ~Mod~ 13] ~Partition~ 4 // Total {12, 11, 13, 12} This is the number of non-ace ...


2

Just for fun: You can count number of "aces" (obviously arbitrary choice) 4 sets of 13 cards: Total /@ Partition[ Boole[Mod[#, 13] == 1] & /@ RandomSample[Range@52, 52], 13] For simulation: tab[n_] := Table[Total /@ Partition[Boole[Mod[#, 13] == 1] & /@ RandomSample[Range@52, 52], 13], {n}]; Now cheating by just testing ...



Only top voted, non community-wiki answers of a minimum length are eligible