The psychology behind games of chance