我似乎无法将这个混乱的输出放入列表中,我知道代码很差,但它可以工作。它从循环的每次迭代中获取一个值,我需要这个输出作为列表。我可以手动完成,但是有 1000 多个值会很痛苦……在此先感谢您的帮助。
For[r = 1, r <= 5, r++,
draws = 1000;
FredList =
Reap[For[i = 1, i <= draws, i++,
Sow[RandomSample[Join[Table["a", {16}], Table["b", {16}]],
2]]];][[2, 1]];
tally = Tally[FredList];
Sort[tally][[All, 2]];
rules = Rule @@@ tally;
{{"a", "a"}, {"b", "b"}, {"b", "a"}, {"a", "b"}} /. rules;
Plotpoints = {{"a", "a"}, {"b", "b"}, {"b", "a"}, {"a", "b"}} /.
rules; Print[Plotpoints[[1]]]]