Source: https://www.pas.rochester.edu/~howell/mysite2/Tutorials/Bells%20Inequalities.pdf