Tossing 4 points on a circle at a time, and calculate the chance of all 4 points on the upper part of the circle.
This is very simple by math:
$$\left( \frac{1}{2} \right)^4 = 0.0625$$
But I want do a simulation in Mathematica.
po = RandomVariate[UniformDistribution[{{0, 1}, {0, 2 Pi}}], 40000000];
f[m_, n_] := {m Cos[n], m Sin[n]};
Apply[f, po, {1}] // Partition[#, 4] & //
Select[#, AllTrue[Last /* GreaterEqualThan[0]]] & //
Length // AbsoluteTiming
it takes around 140 seconds for this code to finish.
Is there a way to speed this up?