最も近い分数を探す表 ― 29%は「3人に1人」ではなく「7人に2人」
作成日: 2023-05-02
1.00% - 1 /100
2.00% - 1 / 50
3.03% - 1 / 33
4.00% - 1 / 25
5.00% - 1 / 20
5.26% - 1 / 19
5.56% - 1 / 18
5.88% - 1 / 17
6.25% - 1 / 16
6.67% - 1 / 15
7.14% - 1 / 14
7.69% - 1 / 13
8.33% - 1 / 12
9.09% - 1 / 11
10.00% - 1 / 10
10.53% - 2 / 19
11.11% - 1 / 9
11.76% - 2 / 17
12.50% - 1 / 8
13.33% - 2 / 15
14.29% - 1 / 7
15.00% - 3 / 20
15.38% - 2 / 13
15.79% - 3 / 19
16.67% - 1 / 6
17.65% - 3 / 17
18.18% - 2 / 11
18.75% - 3 / 16
20.00% - 1 / 5
21.05% - 4 / 19
21.43% - 3 / 14
22.22% - 2 / 9
23.08% - 3 / 13
23.53% - 4 / 17
25.00% - 1 / 4
26.32% - 5 / 19
26.67% - 4 / 15
27.27% - 3 / 11
27.78% - 5 / 18
28.57% - 2 / 7
29.41% - 5 / 17
30.00% - 3 / 10
30.77% - 4 / 13
31.25% - 5 / 16
31.58% - 6 / 19
33.33% - 1 / 3
35.00% - 7 / 20
35.29% - 6 / 17
35.71% - 5 / 14
36.36% - 4 / 11
36.84% - 7 / 19
37.50% - 3 / 8
38.46% - 5 / 13
38.89% - 7 / 18
40.00% - 2 / 5
41.18% - 7 / 17
41.67% - 5 / 12
42.11% - 8 / 19
42.86% - 3 / 7
43.75% - 7 / 16
44.44% - 4 / 9
45.00% - 9 / 20
45.45% - 5 / 11
46.15% - 6 / 13
46.67% - 7 / 15
47.06% - 8 / 17
47.37% - 9 / 19
50.00% - 1 / 2
52.63% - 10 / 19
52.94% - 9 / 17
53.33% - 8 / 15
53.85% - 7 / 13
54.55% - 6 / 11
55.00% - 11 / 20
55.56% - 5 / 9
56.25% - 9 / 16
57.14% - 4 / 7
57.89% - 11 / 19
58.33% - 7 / 12
58.82% - 10 / 17
60.00% - 3 / 5
61.11% - 11 / 18
61.54% - 8 / 13
62.50% - 5 / 8
63.16% - 12 / 19
63.64% - 7 / 11
64.29% - 9 / 14
64.71% - 11 / 17
65.00% - 13 / 20
66.67% - 2 / 3
68.42% - 13 / 19
68.75% - 11 / 16
69.23% - 9 / 13
70.00% - 7 / 10
70.59% - 12 / 17
71.43% - 5 / 7
72.22% - 13 / 18
72.73% - 8 / 11
73.33% - 11 / 15
73.68% - 14 / 19
75.00% - 3 / 4
76.47% - 13 / 17
76.92% - 10 / 13
77.78% - 7 / 9
78.57% - 11 / 14
78.95% - 15 / 19
80.00% - 4 / 5
81.25% - 13 / 16
81.82% - 9 / 11
82.35% - 14 / 17
83.33% - 5 / 6
84.21% - 16 / 19
84.62% - 11 / 13
85.00% - 17 / 20
85.71% - 6 / 7
86.67% - 13 / 15
87.50% - 7 / 8
88.24% - 15 / 17
88.89% - 8 / 9
89.47% - 17 / 19
90.00% - 9 / 10
90.91% - 10 / 11
91.67% - 11 / 12
92.31% - 12 / 13
92.86% - 13 / 14
93.33% - 14 / 15
93.75% - 15 / 16
94.12% - 16 / 17
94.44% - 17 / 18
94.74% - 18 / 19
95.00% - 19 / 20
96.00% - 24 / 25
96.97% - 32 / 33
98.00% - 49 / 50
99.00% - 99 /100
adhoc = [[25,1], [25,24],[33,1],[33,32],[50,1],[50,49],[100,1],[100,99]]
puts ((1..20).flat_map{|n| (1...n).map{|m| [n,m]}} + adhoc).map{|(n,m)| [1.0*m/n, n, m] }.sort.uniq{|(a,_,_)| a}.map{|(a,n,m)| format "%5.2f%% - %2d /%3d", a*100, m, n}
この場合はStern–Brocot木を使うまでもない。