```
We can use simple programs in JavaScript to calculate any probability.
See JavaScript. Some example.

1) What is the probability that a family with 5 children has 3 sons and 2 daughters? (suppose that the
sexes are equally probable and that the sex of a new child is independent of that of the previous one)

<pre><script> with(Math) {
n=1e3; x=0; for(i=0; i<n; i=i+1)
{ U1=floor(random()*2); U2=floor(random()*2); U3=floor(random()*2); U4=floor(random()*2); U5=floor(random()*2)
s=0; if(U1+U2+U3+U4+U5==3) s=1;  x=x+s }
document.writeln ("n=",n,"  fr = ", x/n*100,"%")
n=1e4; x=0; for(i=0; i<n; i=i+1)
{ U1=floor(random()*2); U2=floor(random()*2); U3=floor(random()*2); U4=floor(random()*2); U5=floor(random()*2)
s=0; if(U1+U2+U3+U4+U5==3) s=1;  x=x+s }
document.writeln ("n=",n,"  fr = ", x/n*100,"%")
} </script></pre>

n=1000  fr = 33.7%
n=10000  fr = 30.34%

<pre><script> with(Math) {
n=1e5; x=0; for(i=0; i<n; i=i+1)
{ U1=floor(random()*2); U2=floor(random()*2); U3=floor(random()*2); U4=floor(random()*2); U5=floor(random()*2)
s=0; if(U1+U2+U3+U4+U5==3) s=1;  x=x+s }
document.writeln ("n=",n,"  fr = ", x/n*100,"%")
n=1e6; x=0; for(i=0; i<n; i=i+1)
{ U1=floor(random()*2); U2=floor(random()*2); U3=floor(random()*2); U4=floor(random()*2); U5=floor(random()*2)
s=0; if(U1+U2+U3+U4+U5==3) s=1;  x=x+s }
document.writeln ("n=",n,"  fr = ", x/n*100,"%")
} </script></pre>

n=100000  fr = 30.924%
n=1000000  fr = 31.3023%

<pre><script> with(Math) {
n=1e7; x=0; for(i=0; i<n; i=i+1)
{ U1=floor(random()*2); U2=floor(random()*2); U3=floor(random()*2); U4=floor(random()*2); U5=floor(random()*2)
s=0; if(U1+U2+U3+U4+U5==3) s=1;  x=x+s }
document.writeln ("n=",n,"  fr = ", x/n*100,"%")
} </script></pre>

After a few seconds:
n=10000000  fr = 31.28317%

In fact the possible cases are 2*2*2*2*2 = 32 and the favorable ones are 10, and 10/32 = 31.25%

2) In a dice game players throw three dice; who first gets at least 2 equal numbers wins.
What is the probability of getting this in a throw?

<pre><script> with(Math) {
n=1e3; x=0; for(i=0; i<n; i=i+1)
{ U1=floor(random()*6+1); U2=floor(random()*6+1); U3=floor(random()*6+1);
s=0; if(U1==U2||U1==U3||U2==U3) s=1;  x=x+s }
document.writeln ("n=",n,"  fr = ", x/n*100,"%")
n=1e4; x=0; for(i=0; i<n; i=i+1)
{ U1=floor(random()*6+1); U2=floor(random()*6+1); U3=floor(random()*6+1);
s=0; if(U1==U2||U1==U3||U2==U3) s=1;  x=x+s }
document.writeln ("n=",n,"  fr = ", x/n*100,"%")
n=1e5; x=0; for(i=0; i<n; i=i+1)
{ U1=floor(random()*6+1); U2=floor(random()*6+1); U3=floor(random()*6+1);
s=0; if(U1==U2||U1==U3||U2==U3) s=1;  x=x+s }
document.writeln ("n=",n,"  fr = ", x/n*100,"%")
n=1e6; x=0; for(i=0; i<n; i=i+1)
{ U1=floor(random()*6+1); U2=floor(random()*6+1); U3=floor(random()*6+1);
s=0; if(U1==U2||U1==U3||U2==U3) s=1;  x=x+s }
document.writeln ("n=",n,"  fr = ", x/n*100,"%")
} </script></pre>
n=1000  fr = 45.8%
n=10000  fr = 44.17%
n=100000  fr = 44.311%
n=1000000  fr = 44.4741%

I can proceed, even if it takes more time, with larger n:
<pre><script> with(Math) {
n=1e7; x=0; for(i=0; i<n; i=i+1)
{ U1=floor(random()*6+1); U2=floor(random()*6+1); U3=floor(random()*6+1);
s=0; if(U1==U2||U1==U3||U2==U3) s=1;  x=x+s }
document.writeln ("n=",n,"  fr = ", x/n*100,"%")
} </script></pre>
n=10000000  fr = 44.47879%

<pre><script> with(Math) {
n=1e8; x=0; for(i=0; i<n; i=i+1)
{ U1=floor(random()*6+1); U2=floor(random()*6+1); U3=floor(random()*6+1);
s=0; if(U1==U2||U1==U3||U2==U3) s=1;  x=x+s }
document.writeln ("n=",n,"  fr = ", x/n*100,"%")
} </script></pre>
n=100000000  fr = 44.44092%

I sense that the probability could be 0.444… = 4/9.
In fact, it can be demonstrated that this is the case.
[it is better to think about the opposite case, calculating the probability that all exits
are different: the probability that the 2nd is different from the first is 5/6, 5 cases out
of 6; those who the 3rd is different from the previous ones is 4/6; the opposite case has
probability 1-5/6*4/6 = 4/9]

```