Skip to content

Instantly share code, notes, and snippets.

@quanon
Last active August 29, 2015 14:19
Show Gist options
  • Save quanon/a7146e209d34217ce54a to your computer and use it in GitHub Desktop.
Save quanon/a7146e209d34217ce54a to your computer and use it in GitHub Desktop.
集合から要素を n 回取り出した際に重複あり/重複なしがちょうど半々となるには?

問題

x 面のダイスがある。それを n 回振り、ダイスの数ごとに出た回数をカウントする。
この時、出た回数が 1 回の目の種類と 2 回以上の目の種類の比率が
1:1 となるには x は何である必要があるか。n を使って表せ。

出た回数が 1 回の目の数、2 回以上の目の数の比率が 1:1 となるってどういうこと?

x = 12 (12 面ダイス)
n = 10 (10 回振った)

1
2 ●
3 ●●
4
5 ●●●
6 ●
7
8 ●
9
10 ●●
11
12

出た回数が 1 回の目 : 2, 6, 8 … 3種類
出た回数が 2 回以上の目: 3, 5, 10 … 3種類

この場合、ちょうど 3 : 3 = 1 : 1 になっている。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment