Who was the first to set out the rules of chance? We don’t know the names of the North African mathematicians who first used probability to decipher codes during the middle ages. The first European to write it down, hundreds of years later, was Girolamo Cardano. He applied his knowledge at the gambling tables.