Odds and Probability - Elements of AI 3-1
Odds and Probability - Elements of AI 3-1
Elements of AI
Take a self-driving car for example — you can set the goal to get from A to B in an efficient
and safe manner that follows all laws. But what happens if the traffic gets worse than
expected, maybe because of an accident ahead? Sudden bad weather? Random events like a
ball bouncing in the street, or a piece of trash flying straight into the car’s camera?
https://course.elementsofai.com/3/1 1/15
7/22/2020 Odds and probability - Elements of AI
A self-driving car needs to use a variety of sensors, including sonar-like ones and cameras, to
detect where it is and what is around it. These sensors are never perfect as the data from the
sensors always includes some errors and inaccuracies called “noise”. It is very common then
that one sensor indicates that the road ahead turns left, but another sensor indicates the
opposite direction. This needs to be resolved without always stopping the car in case of even
a slightest amount of noise.
Probability
One of the reasons why modern AI methods actually work in real-world problems – as
opposed to most of the earlier “good old-fashioned" methods in the 1960-1980s – is their
ability to deal with uncertainty.
https://course.elementsofai.com/3/1 2/15
7/22/2020 Odds and probability - Elements of AI
Note
However, probability has turned out to be the best approach for reasoning under uncertainty,
and almost all current AI applications are based, to at least some degree, on probabilities.
https://course.elementsofai.com/3/1 3/15
7/22/2020 Odds and probability - Elements of AI
https://course.elementsofai.com/3/1 4/15
7/22/2020 Odds and probability - Elements of AI
Note
The fact that uncertainty can be quantified is of paramount importance, for example, in
decisions concerning vaccination or other public policies. Before entering the market, any
vaccine is clinically tested, so that its benefits and risks have been quantified. The risks are
never known to the minutest detail, but their magnitude is usually known to sufficient
degree that it can be argued whether the benefits outweigh the risks.
Note
we don’t know exactly whether a vaccine may cause a harmful side-e ect, it is too dangerous to
use. However, this may lead us to ignore a life-threatening disease that the vaccine will
eradicate. In most cases, the benefits and risks are known to su cient precision to clearly see
that one is more significant than the other.
The above lesson is useful in many everyday scenarios and professionally: for example,
medical doctors, judges in a court of law, or investors have to process uncertain information
and make rational decisions based on them. Since this is an AI course, we will discuss how
probability can be used to automate uncertain reasoning. The examples we will use include
medical diagnosis (although it is usually not a task that we’d wish to fully automate), and
identifying fraudulent email messages (“spam”).
Answered
probability (choose "right"), that the forecast was wrong (choose "wrong"), or can
we conclude neither way (choose "cannot be concluded")?
or 100% chance for Trump if there simply isn't enough information available to
anticipate the outcome. In other words, perhaps Trump's victory had a rare (or rareish)
event with 28.6% probability. Such events are expected to happen in more than one
out of four cases, after all.
Odds
Probably the easiest way to represent uncertainty is through odds. They make it particularly
easy to update beliefs when more information becomes available (we will return to this in
the next section).
Before we proceed any further, we should make sure you are comfortable with doing basic
manipulations on ratios (or fractions). As you probably recall, fractions are numbers like 3/4
or 21/365. We will need to multiply and divide such things, so it's good to refresh these
operations if you feel unsure about them. A compact presentation for those who just need a
quick reminder is Wikibooks: Multiplying Fractions. Another fun animated presentation of
the basic operations is Math is Fun: Using Rational Numbers. Feel free to consult your
favorite source if necessary.
By odds, we mean an expression like 3:1 (three to one), which means that we expect that for
every three cases of an outcome, for example winning a bet, there is one case of the opposite
outcome, not winning the bet. (In gambling terms, the odds are usually given from the
bookmakers point of view, so 3:1 usually means that your chances of winning are 1:3.) The
other way to express the same would be to say that the chances of winning are 3/4 (three in
https://course.elementsofai.com/3/1 9/15
7/22/2020 Odds and probability - Elements of AI
four). These are called natural frequencies since they involve only whole numbers. With
whole numbers, it is easy to imagine, for example, four people out of whom, three have
brown eyes. Or four days out of which it rains on three (if you’re in Helsinki).
Note
https://course.elementsofai.com/3/1 10/15
7/22/2020 Odds and probability - Elements of AI
An important thing to notice is that while expressed as two numbers, 3 and 1 for example,
the odds can actually be thought of as a single fraction or a ratio, for example 3/1 (three
divided by one) which is equal to 3. Thus, the odds 3:1 is the same as the odds 6:2 or 30:10
since these ratios are also equal to 3. Likewise, the odds 1:5 can be thought of as 1/5 (one
divided by five) which equals 0.2. Again, this is the same as the odds 2:10 or 10:50 because
that's what you get by dividing 2 by 10 or 10 by 50. But be very careful! The odds 1:5 (one win
for every five losses), even if it can be expressed as the decimal number 0.2, is different from
20% probability (or probability 0.2 using the mathematicians' notation). The odds 1:5 mean
that you'd have to play the game six times to get one win on the average. The probability 20%
means that you'd have to play five times to get one win on the average.
For odds that are greater than one, such as 5:1, it is easy to remember that we are not dealing
with probabilities because no probability can be greater than 1 (or greater than 100%), but
for odds that are less than one such as 1:5, the danger of confusion lurks around the corner.
So make sure you always know when we are talking about odds and when we are talking
about probabilities.
The following exercise will help you practice dealing with correspondence between odds
and probabilities. Don't worry if you make some mistakes at this stage: the main goal is to
learn the skills that you will need in the next sections.
https://course.elementsofai.com/3/1 11/15
7/22/2020 Odds and probability - Elements of AI
Answered
Exercise 9: Odds
As we already mentioned above, the odds 3:1 – for example three rainy days for
each rainless day – corresponds to probability 0.75 (or in percentages 75%).
In general, if the odds in favor of an event are x:y, the probability of the event is
given by x / (x+y). Try that with the odds 3:1 if you like. You should get the answer
0.75.
As we also pointed out, the odds 6:2 corresponds to exactly the same probability
as the odds 3:1 because when we let x=6 and y=2, and write them in the formula x
/ (x+y), we get 6/(6+2), which comes out as 6/8 = 3/4 = 0.75.
Your task:
For the first three items 1–3, convert from odds to probabilities expressed as
natural frequencies; for example from 1:1 to 1/2. Give your answer as a fraction, for
example 2/3.
For the last three items 4–6, convert the odds into probabilities expressed as
percentages (e.g. 4.2%). Give your answer in percentages using a single decimal,
for example 12.2%.
Hint: the calculations are to be calculated with a simple calculator and the
formulas can be found above.
https://course.elementsofai.com/3/1 12/15
7/22/2020 Odds and probability - Elements of AI
The odds for getting three of a kind in poker are about 1:46.
Your answer: 3:1
The odds for getting three of a kind in poker are about 1:46.
Your answer: 206:159
https://course.elementsofai.com/3/1 13/15
7/22/2020 Odds and probability - Elements of AI
Incorrect. Previously we had the probability as 1/(1+ 46) = 1/47, which gives us roughly 0.0213,
which rounds to 2.1%.
https://course.elementsofai.com/3/1 14/15
7/22/2020 Odds and probability - Elements of AI
Next section
Course overview
About
FAQ
Privacy Policy
https://course.elementsofai.com/3/1 15/15