Guest wrote:You're right. The code must be slightly adapted for each LHV model. If each lambda is a pair (e,s), in which e=(e1,e2,e3) and s is a scalar, then we can use:

- Code: Select all
`rm(list = ls())`

N <- 10^4

lambda <- matrix(nrow = N, ncol = 4)

# for each line of the matrix lambda, the first three coordinates

# will be e and the fourth coordinate will be s

A <- function(a, lambda) { # angle a will be in degrees

e <- lambda[1:3]

s <- lambda[4]

# insert your code here

}

B <- function(b, lambda) { # angle b will be in degrees

e <- lambda[1:3]

s <- lambda[4]

# insert your code here

}

# don't change anything after this point

for (a in runif(2, 0, 360)) {

for (b in runif(2, 0, 360)) {

cat("(a, b) = (", a, ", ", b, ")\n", sep = "")

cat("LHV: ",

mean(apply(lambda, 1, function(lambda) A(a, lambda)) *

apply(lambda, 1, function(lambda) B(b, lambda))), "\n")

cat("QM: ", -cos((a-b)*pi/180), "\n\n")

}

}

This is still far too restrictive. It only proves that the limited (I would even say unimaginative) LHV model you have set up may not produce the QM result. So what?

There is also a further problem, although it may not be serious: a and b are not random variables. They are arbitrarily chosen settings, not randomly chosen settings.

You didn't answer my question. Why is the following simulation not a simulation of a LHV model?

Joy Christian wrote:

To see how this can be accomplished in a manifestly local-realistic manner, please take a look at this R code and tell us why it is not a simulation of a LHV model.

The essential part of the code is very simple, and it reproduces the strong correlation in full compliance with all of the requirements of Bell for a LHV model:

- Code: Select all
`A = +sign(g(a,e,s)) # Alice's measurement results A(a, e, s) = +/-1`

B = -sign(g(b,e,s)) # Bob's measurement results B(b, e, s) = -/+1

N = length((A*B)[A & B]) # Number of all possible events observed in S^3

corrs[i,j] = sum(A*B)/N # Product moment correlation coefficient E(a, b)

Here Bell's hidden variable "lambda" is a pair (e, s), where e is like your "vector" and s is another scalar parameter.