It is shown that the Bell inequalities are closely related to the triangle inequalities involving
distance functions amongst pairs of random variables with values ##IMG##
[http://ej.iop.org/images/0143-0807/37/5/055402/ejpaa29fdieqn1.gif] {${0,1}$} . A hidden variables
model may be defined as a mapping between a set of quantum projection operators and a set of random
variables. The model is noncontextual if there is a joint probability distribution. The Bell
inequalities are necessary conditions for its existence. The inequalities are most relevant when
measurements are performed at space-like separation, thus showing a conflict between quantum
mechanics and local realism (Bell’s theorem). The relations of the Bell inequalities with
contextuality, the Kochen–Specker theorem, and quantum entanglement are briefly discussed.