As promised here is the 3 Do loop version. All independent and run at different times. One for particle and hidden variable generation and then separate A and B loops for detection. Note that I now have both hidden variables as functions of the singlet vector so all you need is the singlet vector and the
a and
b vectors to predict the A and B outcomes.
I could only run 200,000 trials at one degree resolution as the trial number matching function is very time consuming. I tried 300,000 and aborted after 12 hours of running because I had other things to do.

But easy to see that it is converging to
-a.b. Here are the PDF and Mathematica notebook files. I did do some minor tweaking of the adjustable parameters.
EPRsims/posneg_forum3.pdfEPRsims/posneg_forum3.nbEnjoy! And ask questions if you don't understand something.
,