; this returns EPR pairs. (let ((pi (* 4 (atan 1))) (sq (lambda (x) (* x x)))) (lambda (seed) (let ((bc ((fileVal "bCoin") seed)) (U (((fileVal "RC4") seed) 'U))) (lambda () (let* ((th #f) (x (lambda (theta) (if th (bc (sq (cos (- th theta)))) (if (bc 0.5) (begin (set! th theta) #t) (begin (set! th (+ (/ pi 2) theta)) #f)))))) (cons x x)))))) ; tests: (define ppg ((fileVal "EPR") "glosh")) ; (define ex (lambda (m v) (write (list m v)) (newline) v)) (define U (((fileVal "RC4") "BiLge") 'U)) (define pi (* 4 (atan 1))) (define (t da) (let* ((H (make-vector 4 0))) (((fileVal "Do") 'Do) 10000 (lambda (_) (let* ((pp (ppg))(x (car pp))(y (cdr pp)) (th (* pi (U))) (n (+ (if (x th) 1 0) (if (y (+ th da)) 2 0)))) (vector-set! H n (+ 1 (vector-ref H n)))))) H)) (list (t 0) (t (/ pi 2)) (t (/ pi 4))) ; => (#4(4949 0 0 5051) #4(0 5076 4924 0) #4(2421 2501 2535 2543))