christian.R

richard — May 2, 2014, 10:50 AM

## My response to Christian's claim to my prize.
## First I delete all lines from his code except those generating
## the set of directions "e"

set.seed(9875)
N <- 10^5
s <- runif(N, 0, pi)
t <- runif(N, 0, pi)
x <- cos(s)/1.28
y <- -1 + (2/(sqrt(1 + (3 * t/pi))))
e <- rbind(x, y)  ## 2 x N matrix; N columns of e represent the
## x and y coordinates of points on a circle: 
## Alice's observed directions of angular momentum.
## Bob's observed directions are -e.


## Now I separately compute four correlations according to the
## formulas agreed by Christian

alpha <- 0 * pi / 180
beta <- 45 * pi / 180
a <- c(cos(alpha), sin(alpha))
b <- c(cos(beta), sin(beta))
(E_0_45 <- mean(sign(colSums(e * a)) * -sign(colSums(e * b))))
[1] -0.6842

alpha <- 0 * pi / 180
beta <- 135 * pi / 180
a <- c(cos(alpha), sin(alpha))
b <- c(cos(beta), sin(beta))
(E_0_135 <- mean(sign(colSums(e * a)) * -sign(colSums(e * b))))
[1] 0.6838

alpha <- 90 * pi / 180
beta <- 45 * pi / 180
a <- c(cos(alpha), sin(alpha))
b <- c(cos(beta), sin(beta))
(E_90_45 <- mean(sign(colSums(e * a)) * -sign(colSums(e * b))))
[1] -0.3133

alpha <- 90 * pi / 180
beta <- 135 * pi / 180
a <- c(cos(alpha), sin(alpha))
b <- c(cos(beta), sin(beta))
(E_90_135 <- mean(sign(colSums(e * a)) * -sign(colSums(e * b))))
[1] -0.3187

## Just for fun
 - E_0_45 + E_0_135 - E_90_45 - E_90_135
[1] 2