Definitions of probability

There are many ways to define probability, based on a given situation and the type of game or application you are building. The most commonly used definition of probability is to consider the probability of an event as the frequency with which the event occurs when we repeat the observation an infinite amount of times. In other words, if we throw a die 100 times, we expect to see a six, on average, 1/6th of the times, and we should get closer and closer to 1/6th with 1,000/10,000/one million throws.

We can write the probability for an event A to occur as P(A). To calculate P(A) we need to know all the possible outcomes (N) for the observation and the total number of times in which the desired event occurs (n).

Get Unity Artificial Intelligence Programming - Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.