Theoretical Probability: A Real-Life Example (from Artificial Intelligence)

Probability theory and the calculation of theoretical probability play a crucial role in Artificial Intelligence. This blog post presents a specific example of how theoretical probability is utilized in machine translation.

Theoretical Probability in Machine Translation


Machine translation is a fascinating part of Artificial Intelligence technology, where computers learn to understand and translate words and sentences from one language to another. You’ve likely used machine translation websites like Google Translate or DeepL.

One of the main challenges in machine translation is selecting the right word, given that words often have multiple meanings. Calculating theoretical probability becomes a valuable tool in solving this problem. Let’s explore a specific example.

Calculating Theoretical Probability: Example

Let’s explore how to translate the sentence ‘The dog developed a large bark’ into Spanish, for instance. For us humans, it’s obvious that the word ‘bark’ in this sentence is associated with ‘dog bark’ (not ‘tree bark’). But how could the computer make a difference? Should it be translated into Spanish as ‘ladrido’ (dog bark) or ‘corteza’ (tree bark)?

The word "bark" can mean both "dog bark" and "tree bark".

One method to create a computer algorithm that distinguishes between ‘ladrido’ (dog bark) and ‘corteza’ (tree bark) is to define the theoretical probability of word pairs appearing together. For example, the computer can analyze sentences mentioning both ‘dog’ and ‘bark’ and then decide: if the word ‘bark’ is more frequently associated with ‘dog’ than with ‘tree,’ the computer assigns a higher probability to the word ‘ladrido’ (dog bark).

To illustrate this further, let’s take the story ‘A Yellow Dog’ by Bret Harte, in Spanish and English.

English and Spanish texts of the story "A Yellow Dog" by Bret Harte aside.

In the original (English) story, the word ‘dog’ appears 22 times, and ‘bark’ is used 3 times. In the Spanish translation, ‘bark’ is translated 2 times as ‘dog bark’ and 1 time as ‘tree bark.’ Therefore, we can calculate the theoretical probability of the translation as ‘dog bark’ as 2/3, and the probability of the translation as ‘tree bark’ is 1/3. Based on this probability, the computer can decide that when ‘dog’ and ‘bark’ are used together, ‘bark’ most likely means ‘dog bark’ (2/3 vs. 1/3).


This example illustrates how computer algorithms can use calculated theoretical probability when selecting a word from multiple options. What you’ve just seen is a simple demonstration of how Artificial Intelligence works. Theoretical probability proves valuable in various Artificial Intelligence applications, guiding computer programs in decision-making through probability calculations. Contrary to popular belief, AI doesn’t ‘think’ like humans; instead, it executes tasks based on pre-programmed rules, and calculating probability is one of these fundamental rules.


For creating this article, we gathered information from various scientific publications, including:

Additionally, check the books mentioned in the article (A Yellow Dog by Bret Harte):

Video Version

The video version of this blog post provides more examples of calculating theoretical probability based on real books, including those by Jack London. It also explains why Artificial Intelligence algorithms require a vast amount of data for training and showcases why machine translation websites sometimes make amusing mistakes. As always, the video version presents the story in an animated and easy-to-follow manner. Check the preview below or subscribe to gain access to all our full videos.

Like this article?

Read more from our blog: