Giving computers free will - the mathematics of cause and effect