You are on page 1of 39

Introduction to Artificial Intelligence

• One of the booming technologies of computer


science is Artificial Intelligence which is ready to
create a new revolution in the world by making
intelligent machines.
• The Artificial Intelligence is now all around us.
• It is currently working with a variety of subfields,
ranging from general to specific, such as self-
driving cars, playing chess, proving theorems,
playing music, Painting, etc.
• Artificial Intelligence is composed of two
words Artificial and Intelligence, where Artificial
defines "man-made," and intelligence
defines "thinking power", hence AI means "a
man-made thinking power."
• "It is a branch of computer science by which we can
create intelligent machines which can behave like a
human, think like humans, and able to make decisions."
• Artificial Intelligence exists when a machine can have
human based skills such as learning, reasoning, and
solving problems.
• With the help of AI, you can create such software or
devices which can solve real-world problems very easily
and with accuracy such as health issues, marketing,
traffic issues, etc.
• With the help of AI, you can create your personal virtual
Assistant, such as Cortana, Google Assistant, Siri, etc.
• With the help of AI, you can build such Robots which can
work in an environment where survival of humans can be
at risk.
• AI opens a path for other new technologies, new devices,
and new Opportunities.
Goals of Artificial Intelligence
• Following are the main goals of Artificial Intelligence:
1. Replicate human intelligence
2. Solve Knowledge-intensive tasks
3. An intelligent connection of perception and action
4. Building a machine which can perform tasks that
requires human intelligence such as:
1. Proving a theorem
2. Playing chess
3. Plan some surgical operation
4. Driving a car in traffic
5. Creating some system which can exhibit intelligent
behavior, learn new things by itself, demonstrate,
explain, and can advise to its user.
What Comprises to Artificial Intelligence?
• Artificial Intelligence is a combination of Reasoning, learning,
problem-solving perception, language understanding, etc.
• To achieve the above factors for a machine or software
Artificial Intelligence requires the following discipline:
• Mathematics
• Biology
• Psychology
• Sociology
• Computer Science
• Neurons Study
• Statistics
Advantages of Artificial Intelligence
• Following are some main advantages of Artificial Intelligence:
• High Accuracy with less errors: AI machines or systems are prone to
less errors and high accuracy as it takes decisions as per pre-
experience or information.
• High-Speed: AI systems can be of very high-speed and fast-decision
making, because of that AI systems can beat a chess champion in the
Chess game.
• High reliability: AI machines are highly reliable and can perform the
same action multiple times with high accuracy.
• Useful for risky areas: AI machines can be helpful in situations such
as defusing a bomb, exploring the ocean floor, where to employ a
human can be risky.
• Digital Assistant: AI can be very useful to provide digital assistant to
the users such as AI technology is currently used by various E-
commerce websites to show the products as per customer
requirement.
• Useful as a public utility: AI can be very useful for public utilities such
as a self-driving car which can make our journey safer and hassle-
free, facial recognition for security purpose, Natural language
processing to communicate with the human in human-language,
etc.
Disadvantages of Artificial Intelligence
• Every technology has some disadvantages, and the same goes for
Artificial intelligence. Being so advantageous technology still, it has some
disadvantages which we need to keep in our mind while creating an AI
system.
Following are the disadvantages of AI:
• High Cost: The hardware and software requirement of AI is very costly
as it requires lots of maintenance to meet current world requirements.
• Can't think out of the box: Even we are making smarter machines with
AI, but still they cannot work out of the box, as the robot will only do that
work for which they are trained, or programmed.
• No feelings and emotions: AI machines can be an outstanding
performer, but still it does not have the feeling so it cannot make any kind
of emotional attachment with human, and may sometime be harmful for
users if the proper care is not taken.
• Increase dependency on machines: With the increment of technology,
people are getting more dependent on devices and hence they are losing
their mental capabilities.
• No Original Creativity: As humans are so creative and can imagine
some new ideas but still AI machines cannot beat this power of human
intelligence and cannot be creative and imaginative.
History of AI- AI Techniques
Maturation of Artificial Intelligence (1943-1952)
• Year 1943: The first work which is now recognized as
AI was done by Warren McCulloch and Walter pits in
1943. They proposed a model of artificial neurons.
• Year 1949: Donald Hebb demonstrated an updating
rule for modifying the connection strength between
neurons. His rule is now called Hebbian learning.
• Year 1950: The Alan Turing who was an English
mathematician and pioneered Machine learning in
1950. Alan Turing publishes "Computing Machinery
and Intelligence" in which he proposed a test. The
test can check the machine's ability to exhibit
intelligent behavior equivalent to human intelligence,
called a Turing test.
The birth of Artificial Intelligence (1952-1956)
• Year 1955: An Allen Newell and Herbert A.
Simon created the "first artificial intelligence
program"Which was named as "Logic
Theorist". This program had proved 38 of 52
Mathematics theorems, and find new and more
elegant proofs for some theorems.
• Year 1956: The word "Artificial Intelligence"
first adopted by American Computer scientist
John McCarthy at the Dartmouth Conference.
For the first time, AI coined as an academic field.
• At that time high-level computer languages such
as FORTRAN, LISP, or COBOL were invented.
And the enthusiasm for AI was very high at that
time.
The golden years-Early enthusiasm (1956-1974)

• Year 1966: The researchers emphasized


developing algorithms which can solve
mathematical problems. Joseph
Weizenbaum created the first chatbot in
1966, which was named as ELIZA.
• Year 1972: The first intelligent humanoid
robot was built in Japan which was named
as WABOT-1.
The first AI winter (1974-1980)
• The duration between years 1974 to 1980
was the first AI winter duration.
• AI winter refers to the time period where
computer scientist dealt with a severe
shortage of funding from government for AI
researches.
• During AI winters, an interest of publicity on
artificial intelligence was decreased.
A boom of AI (1980-1987)
• Year 1980: After AI winter duration, AI
came back with "Expert System". Expert
systems were programmed that emulate
the decision-making ability of a human
expert.
• In the Year 1980, the first national
conference of the American Association of
Artificial Intelligence was held at Stanford
University.
The second AI winter (1987-1993)
• The duration between the years 1987 to
1993 was the second AI Winter duration.
• Again Investors and government stopped
in funding for AI research as due to high
cost but not efficient result. The expert
system such as XCON was very cost
effective.
The emergence of intelligent agents (1993-
2011)
• Year 1997: In the year 1997, IBM Deep Blue
beats world chess champion, Gary Kasparov,
and became the first computer to beat a
world chess champion.
• Year 2002: for the first time, AI entered the
home in the form of Roomba, a vacuum
cleaner.
• Year 2006: AI came in the Business world till
the year 2006. Companies like Facebook,
Twitter, and Netflix also started using AI.
Deep learning, big data and artificial general
intelligence (2011-present)
• Year 2011: In the year 2011, IBM's Watson won jeopardy,
a quiz show, where it had to solve the complex questions
as well as riddles. Watson had proved that it could
understand natural language and can solve tricky
questions quickly.
• Year 2012: Google has launched an Android app feature
"Google now", which was able to provide information to
the user as a prediction.
• Year 2014: In the year 2014, Chatbot "Eugene
Goostman" won a competition in the infamous "Turing
test."
• Year 2018: The "Project Debater" from IBM debated on
complex topics with two master debaters and also
performed extremely well.
• Google has demonstrated an AI program "Duplex" which
was a virtual assistant and which had taken hairdresser
appointment on call, and lady on other side didn't notice
that she was talking with the machine.
Problem Solving with AI- AI models
1. Defining the Problem–the problem is to be
defined precisely so that desirable solution of the
given problem can be reached.
2. Analysing the Problem–the problem area is
properly understood and then decisions regarding
how to reach solutions is taken. This is pertinent
as some features of the problem may affect the
solution for that problem.
3. Identifying Solutions–here a number of possible
solutions are generated for the given problem.
4. Choosing the Best Solution–from the identified
solutions a best solution for the problem is chosen.
5. Implementing the Solution–after the choice for
the best solution is made it is implemented.
AI models
• An artificial intelligence (AI) model is a
program that analyzes datasets to find
patterns and make predictions.
• AI modeling is the development and
implementation of the AI model.
• AI modeling replicates human intelligence
and is most effective when it receives multiple
data points.
• Organizational implementation of an AI
model can accurately solve complex issues
while keeping operational cost low.
Initial steps to AI modeling
Modeling
• After gathering quality data, the user creates an AI
model that replicates human intelligence and decision
making.
Training
• The user provides the AI model quality datasets. The
data has three processing phases: training,
validation, and testing. Throughout the three phases,
the AI model interprets the data to draw conclusions.
Inference
• Before this step, the AI model needs to be extensively
trained. Once trained, the user provides a live
dataset and launches the model for practical
usage.
AI models vs. machine learning models

• AI models are designed to replicate human


intelligence using algorithms, whereas
machine learning (ML) is designed to teach
machines to operate and optimize
themselves.
• With ML, the machine will learn from
previous decisions to improve its efficiency
over time.
• While all ML models are AI models, not every
AI model is an ML model.
Popular AI models
Each AI model works differently while serving a specific purpose. There is an
overlap between ML and AI due to all ML models being AI models.
Users may combine models to achieve a target function. These are ten
popular models among AI and ML systems:
Deep Neural Networks (DNN)
• DNN is a subset of ML. DNN imitates the human brain with multiple
layers for input variables to pass through.
Linear Regression
• Linear regression, a common ML type, searches for a correlation
between input and output variables.(Cost dependent - capacity of RAM
independent)
Logistic Regression
• Logistic regression is a subset of ML which estimates the outcome and
predicts one of two values for dependent variables.
(Examples: Deciding on whether or not to offer a loan to a bank customer:
Outcome = yes or no)
Learning Vector Quantization (LVQ)
• LVQ groups similar input values into data points, then into
prototypes. (single or multiple data sources are transformed into a
resultant dataset)
K-nearest Neighbors (KNN)
• KNN is an ML algorithm that groups input values to be graphed near one
another.
• K-nearest neighbors (KNN) is a machine learning algorithm that classifies
data points based on how their neighbors are classified.
• KNN is a supervised learning (uses labeled datasets to train algorithms)
classifier that uses proximity to make classifications or predictions.
Linear Discriminant Analysis (LDA)
• LDA is a subsection of logistic regression. It is most frequently used when
more than two values need to be defined in the output.
Decision Trees
• Decision trees are a supervised ML algorithm considered to be one of the
most efficient AI models. Decision trees solve regression and
classification problems using previous datasets.
Random Forest
• A type of ML that uses multiple decision trees to produce accurate
decisions.
Support Vector Machines
• A common ML model that accurately categorizes information with limited
data..
Naive Bayes
• An ML that assumes the input data values are unrelated.
Data Acquisition
• Data Acquisition (DAQ) is used to gather, measure,
and record data from different sources or sensors in
real-world scenarios.
• This involves the conversion of analog signals into
digital data that computers can process and analyze.
• Data acquisition in the context of Machine Learning
refers to the process of collecting, gathering, and
preparing data from various sources to build and
train a machine learning model.
• The objective is to create a comprehensive and
representative dataset that effectively captures the
patterns and variations inherent in the real-world
problem the machine learning model seeks to tackle.
Data Sources
• Databases: Extracting data from structured
databases such as SQL or NoSQL
databases.
• Files: Gathering data from CSV files, Excel
spreadsheets, text files, and more.
• APIs: Retrieving data from Application
Programming Interfaces (APIs) provided by
various online platforms.
• Web Scraping: Extracting data from websites
by parsing their HTML content.
• Sensors and IoT Devices: Collecting data
from sensors and Internet of Things (IoT)
devices.
Learning Aspects in AI
• Learning deals with acquiring skills or knowledge
which is gained from experience.
• When machines learn in a way which help to train an
algorithm so that it can learn and improve by itself, it is
referred to as AI Learning or Machine Learning in AI.
• Machine learning may involve little or no human
intervention.
• AI learning is a very important aspect of artificial
intelligence as it involves algorithms that allows the
machines to learn automatically from their experience
without the need of human (programmer) intervention.
Common AI Problem Types

https://www.opinosis-analytics.com/blog/15-common-ai-problem-types/
AI Problem Analysis

• When analysing any given problems in AI, we go


through a number of different stages. These
stages are:
• Defining the Problem
• Gathering relevant Data
• Designing the Model
• Model Training
• Evaluating the Model
• Quality Assurance
• Deployment
• Maintenance of the Application
AI Problem Representation
• Before the gathering of relevant
information for the problem, we need to
first define and represent the problem in a
very precise manner.
• This is done using one of the commonly
used approaches to represent a problem
in AI.
These are:
• State Space Representation
• Problem Reduction
State Space Representation
• The state space of a problem can be defined as the set of all
possible states in which a problem can be represented and solved.
• The method of State Space Representation involves the process
of defining the state space, defining the start and the goal states,
and searching for a path from the start state to the goal state
across this state space.
• The state space hence forms a graph or tree, where states are
represented as nodes and the arcs connecting the nodes
represents the actions. The method of search for the goal state
from the start state is governed by a set of rules known as
the production rules.
• Hence, a state space consists of the following:
• Set of States
• Starting State
• Set of Actions and an Action Function
• Set of Goal States
• Criteria to check the quality of the acceptable solution (optional)
Example of State Space Representation

• To understand the concept in a better


manner, let us consider an example to solve
the 8-puzzle.
• 8-puzzle is a tile puzzle which consists of
numbers from 1-8 arranged in a 3 * 3 cube.
• One of the squares of the cube is empty
which facilitates the motion of the squares
numbered 1 to 8.
• The aim of the puzzle is to reach the goal
state where the numbers are arranged in an
ascending order. i.e., as follows
• Now, a standard problem formulation of the above will be
as follows:
• States–It is a set of all possible states where the location
of the blank tile and the numbers will differ in each specific
state.
• Initial State – The state from where the problem starts is
its initial state.
• Goal State – The state to be reached is the goal state.
• Legal Moves – These are the rules which will be followed
in order to reach the goal state. Here, the moves which
are termed as legal are:
• Blank square moves Left
• Blank square moves Right
• Blank square moves Up
• Blank square moves Down
• Cost of Path – If we assume a cost of 1 here then the
cost of the path will be the number of steps taken in order
to reach the goal state.
Advantages of State Space Representation
• State Space Search has the following advantages:
1. It defines a set of all possible states, operations and
goal states.
2. It helps us to trace the path taken starting from the
initial state to the goal state. This helps us in
identifying or tracing the sequence of operations
required in reaching till the goal state.
Disadvantages of State Space Representation
• State Space Search has the following disadvantages:
1. It is practically impossible to explore all the states for
a given problem.
2. Due to the huge combinational states in the state
space, we need a high amount of CPU resources for
the computer system to handle the load efficiently.
Problem Reduction
• It is not an easy task to find the search space for all problems.
• When the problems get complex in nature it becomes easy to solve
the problem by breaking it into smaller problems which would be
easier to solve as compared to the problem as a whole.
• This is where problem reduction method is used.
• In problem reduction method, the given problem is divided or
broken down into a set of sub problems.
• Now, a solution to these sub problems is easy to obtain.
• Once the solutions to the sub problems are derived, these
solutions are hence combined back in order to get to the solution
for the problem as a whole.
• The structure used to represent such problems is known as
an AND OR Graph / Tree.
• In this graph, we select successor nodes based on the branch.
• If the branch is an AND branch, then we find solutions to all
successors here.
• But, when we have an OR branch, then we find one best
successor as the solution.
• Hence this graph is named the AND OR graph (or tree).
Example for AND OR Graph
• Let us assume a situation where you want to
acquire a car for yourselves.
• Now, we would represent this situation using
the AND OR graph as follows.
• If we take a look at the graph, we come to
know that if we pursue the AND branch then
we will have to consider both the successor
nodes as a combined solution for the parent
node.
• Hence as a result we will first have to earn
money first and then buy a car.
• But in case of an OR branch we simply select
one alternate which is to steal here.
• def water(jug1, jug2):
• max1, max2, fill = 3, 4, 2
• print("%d \t%d" % (jug1, jug2))
• if jug2==fill:
• return
• elif jug2==max2:
• water(0,jug1)
• elif jug1!=0 and jug2==0:
• water(0,jug1)
• elif jug1==fill:
• water(jug1,0)
• elif jug1<max1:
• water(max1, jug2)
• elif jug1<(max2-jug2):
• water(0,(jug1+jug2))
• else:
• water(jug1-(max2-jug2), (max2-jug2)+jug2)
• print("Jug 1 \tJug 2")
• water(0,0)

You might also like