模擬同時投兩枚硬幣
Author: 藍邦偉　老師

正面

反面

m=1

兩反面

兩正面

一正一反

投擲兩枚硬幣

n = 1000 (slider from 1 to 1000, step 1)
a = 0.13 (slider from 0 to 1, step 0.01)
k = 0 (slider from 0 to 1000, step 1)
list1 = Sequence(Random[0.0, 1.0] + a * 0.0, i, 1.0, n)
list2 = Sequence(Random[0.0, 1.0] + a * 0.0, i, 1.0, n)
list3 = Sequence(Element[list1, i] + Element[list2, i], i, 1.0, Min[k, n])
list4 = Sequence(CountIf[x ≟ i, list3], i, 0.0, 2.0)
c = Segment((0.0675, -0.135), (30.0675, -0.135))
m: floor(Max[list4] / 20.0) + 1.0
d = Segment((0.0, 0.0), (0.0, 20.0))
b = BarChart({5.0, 15.0, 25.0}, list4 / m, 8.0)
list5 = Sequence(Text["" + (Element[list4, i]), (10.0 * i - 6.0, Element[list4, i] / m + 1.0)], i, 1.0, 3.0)