Unit-3 (Maths For AI)
Unit-3 (Maths For AI)
INTELLIGENCE
UNIT-3
MATHS FOR AI
(Statistics & Probability)
Finding patterns in numbers and images: A key strength of Al models is their ability to identify
patterns and relationships in data, both numerical and image-based.
Consider the sequence of numbers: 2, 4, 6, 8, The pattern is evident: each number increases by 2.
Artificial Intelligence tries to find patterns in similar way.
Consider another sequence: 0, 1, 2, 3, 5, 8, 13, The pattern is that 3rd number onwards, every
number is the sum of previous two numbers.
Artificial Intelligence does the same thing but with tons of data, spotting patterns to make predictions or
solve problems.
Examples of Patterns in Images: In images, visual patterns may be in the form of recurring
shapes, colours, or textures, for example:
AI can identify vehicles in an image by recognizing common features such as wheels, bonnet,
windshield or wind- screen etc.
AI can identify a cat in different images by recognizing common features such as pointy ears and
whiskers.
Given below are a few examples showcasing the importance of pattern recognition in AI:
Spam Detection. By analysing the content and structure of emails, AI can identify patterns
associated with spam messages and filter them out from your inbox.
Medical Diagnosis. Al can analyse medical images such as X-rays or MRIs to detect patterns
indicative of diseases like cancer or fractures.
Weather Forecasting. By analysing historical weather data, AI can identify patterns to predict
future weather conditions with a high degree of accuracy.
Financial Markets. AI algorithms analyse stock market data to identify patterns that signal buying
or selling opportunities for investors.
USE OF MATH IN AI: Math helps AI to understand patterns in numbers and images, just like when you
see a sequence of numbers or pictures and notice a rule or trend.
1. Statistics: This branch of math deals with collecting, analysing, and interpreting data. Al uses statistics
to summarize large datasets, identify trends, and make predictions.
For example, AI-powered recommendation systems use statistics to suggest movies or products based
on your past preferences.
2. Linear Algebra: Linear algebra is the study of vectors, matrices, and linear transformations. It
enabling machines to understand and manipulate data in multiple dimensions (multi-dimensional space).
For example, Al uses linear algebra to process images, recognize patterns, and even generate realistic
images from scratch.
3. Probability: Probability is the study of uncertainty and randomness. Al uses probability theory to
make decisions in uncertain situations.
For example, self-driving cars use probabilistic models to estimate the likelihood of different outcomes,
such as whether a pedestrian will cross the road.
4. Calculus: Calculus deals with rates of change and accumulation. Al uses calculus to optimize processes
and make incremental improvements over time.
For instance, Al-powered search engines use calculus to rank web pages based on their relevance to a
user's query.
NUMBERS PATTERN PICTURES ANALOGY AND AI: Al can work with numbers and images. Al looks
for patterns in numbers, and analogies in pictures.
Following table summarises how Al works with numbers and images, and makes use of them.
Let us have a look at some examples.
Applications of statics: Statistics has a wide range of applications in many real life situations:
1. Disaster Management: When a natural disaster strikes, such as an earthquake or hurricane or flood,
we need data to assess things like:
- How many people are affected ?
- How many areas are affected ?
- How much damage has happened?
For this, statistics are used to analyse data on population density, building structures, and assess the extent
of damage, estimate the number of affected people, and plan rescue operations.
2. Sports: In sports, statistics tell us how well a player or team is performing. Scores, goals, runs these are
all statistics. Statistics helps sports analysts, coaches and players study these numbers for things like:
- to evaluate players' strengths and weaknesses,
- identify key performance indicators,
- giving analytics about chosen parameters
- identify areas of improvement
and make strategic decisions during matches and for future games.
3. Disease Prediction: In the field of healthcare, statistics are used to predict the spread of diseases,
assess the effectiveness of treatments, and identify risk factors, and so on. Doctors use statistics to
understand diseases and their outbreaks.
- How many people are sick?
- What are their symptoms?
- How frequent is the disease occurring?
- Which areas are getting affected?
- Which type of population (e.g., young/old) is getting affected?
- Which type of areas (e.g., closed buildings, urban/rural etc.) are getting affected?
and so on.
4. Weather Forecast: Statistics plays an important role in predicting about future weather.
Meteorologists rely on statistical models to analyse weather data. Weather data is collected from weather
stations, satellites, and other sources.
Using this data, meteorologists can:
- identify patterns and trends in temperature, precipitation, and atmospheric pressure
- develop mathematical models that simulate the behaviour of the atmosphere
- predict future weather conditions and patterns days or even weeks in advance
- issue weather forecasts to the public.
The probability equation defines the likelihood of the happening of an event. It is the ratio of favorable
outcomes to the total possible outcomes.
The probability formula can be expressed as,
P(A) =
So here,
Any event (e.g., getting 1. or 2 or a 6 etc.) will always be a subset of the sample space.
Types of Events: There are different types of events in probability. The most common events are:
1. Certain Events: These are events that will definitely happen. For example, the sun rising in the east is a
certain event. Certain events have the probability of 1.
2. Impossible Events: These are events that will never happen. For example, rolling a 7 on a standard six-
sided dice is impossible. Impossible events have the probability of 0.
3. Likely Events: These are events that have a high chance of happening. For example, if you have 90 red
marbles and 10 blue marbles in a bag, picking a red marble is a likely event. Likely events are high
probability events.
4. Unlikely Events: These are events that have a low chance of happening. For example, picking a blue
marble from the same bag with 90 red marbles and 10 blue marbles is an unlikely event. Unlikely
events are low probability events.
5. Equally Likely Events: These are events that have the same chance of happening. For example, when
you flip a fair coin, getting heads or tails are equally likely events.
Example: Identify the type of event, Let's do a small exercise to see if you can identify the type of event.
We are list some events below. Answer if the given event is this certain, impossible, likely, unlikely, or
equally likely?
i. Flipping a coin and getting heads.
ii. Rolling a dice and getting a number greater than 6.
iii. Picking a red ball from a bag with 1 red ball and 9 blue balls.
iv. Choosing a day of the week and it being Monday.
v. The sun rising tomorrow.
Solution.
(i) Flipping a coin and getting heads. Equally likely event (because getting heads or tails are equally likely
events when flipping a fair coin).
(ii) Rolling a dice and getting a number greater than 6. Impossible event (because a standard dice only has
numbers 1 to 6).
(iii) Picking a red ball from a bag with 1 red ball and 9 blue balls. Unlikely event (because there is only 1
red ball and 9 blue balls).
(iv) Choosing a day of the week and it being Monday. Equally likely event (because any day of the week
has the same chance of being chosen).
(v) The sun rising tomorrow. Certain event (because the sun rises every day.
APPLICATIONS OF PROBABILITY:
1. Probability in Sports: Probability is applied in Sports for various things. Some of these are:
(i) Predicting Game Outcomes: Sports analysts use probability to predict the outcome of games.
For example, if a basketball team has won 80 out of their last 100 games, the probability of them
winning the next game is:
𝟖𝟎
Probability = = 0.8 or 80%
𝟏𝟎𝟎
(ii) Player Performance: Coaches use probability to decide which players to put in the game.
For example, if a soccer player has scored in 10 out of 20 games, the probability of them scoring
in the next game is :
𝟏𝟎
Probability = = 0.5 or 50%
𝟐𝟎
(iii) Game Strategies: Probability helps teams choose the best strategies.
For example, in the game of Cricket, a team might use probability to decide if they should put
fielders at slips. If the probability of getting a catch at a slip point is high, they might go for it. If it
is low, they might not put fielders there.
2. Probability in Weather Forecasts: Probability is applied in weather forecast for various things.
Some of these are:
(i) Chance of Rain: When you hear that there is a 70% chance of rain, it means that in 70 out of 100
similar situations, it rained. This helps people decide if they should carry an umbrella or plan indoor
activities.
(ii) Temperature Predictions: Meteorologists use probability to predict temperatures. For example,
if the average temperature on a specific day in the past years was around 25°C, they might predict a similar
temperature for this year.
(iii) Severe Weather Alerts: Probability helps in predicting severe weather like storms, tornadoes,
and hurricanes. For example, if there is a high probability of a hurricane hitting a coastal area, people can
evacuate in time.
3. Probability in Traffic Estimation: Traffic estimation uses probability to help manage traffic flow
and reduce congestion.
(i) Predicting Traffic jams: By analysing traffic data, engineers can predict when and where traffic
jams are likely to happen. This helps drivers plan their trips better.
(ii) Travel Time Estimation: GPS systems use probability to estimate travel times. They look at
current traffic conditions and historical data to predict how long it will take to get from one place to
another. For example, if it usually takes 30 minutes to travel a certain route but there is a 70% chance of
heavy traffic, the GPS might estimate a longer travel time.
(iii) Accident Predictions: Traffic planners use probability to predict where accidents are likely to
happen. They look at data on road conditions, weather, and driver behaviour. If they find a high probability
of accidents in a certain area, they can make changes to improve safety, like adding traffic lights or speed
bumps.