Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Unit-1 - Artificial Intelligence

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 14

ARTIFICIAL INTELLIGENCE

UNIT – I

Introduction To AI
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."

So, we can define AI as:

"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 Artificial Intelligence you do not need to preprogram a machine to do some work,
despite that you can create a machine with programmed algorithms which can work with
own intelligence, and that is the awesomeness of AI.

It is believed that AI is not a new technology, and some people says that as per Greek myth,
there were Mechanical men in early days which can work and behave like humans.

Why Artificial Intelligence?


Before Learning about Artificial Intelligence, we should know that what is the importance of
AI and why should we learn it. Following are some main reasons to learn about AI:

o 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.
o With the help of AI, you can create your personal virtual Assistant, such as Cortana,
Google Assistant, Siri, etc.
o With the help of AI, you can build such Robots which can work in an environment
where survival of humans can be at risk.
o 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:
o Proving a theorem
o Playing chess
o Plan some surgical operation
o 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.

History of AI
o Throughout history, people have been intrigued by the idea of making non-living
things smart. In ancient times, Greek stories mentioned gods creating clever
machines, and in Egypt, engineers made statues move. Thinkers like Aristotle and
Ramon Llull laid the groundwork for AI by describing how human thinking works
using symbols.
o In the late 1800s and early 1900s, modern computing started to take shape. Charles
Babbage and Ada Lovelace designed machines that could be programmed in the
1830s. In the 1940s, John Von Neumann came up with the idea of storing computer
programs. At the same time, Warren McCulloch and Walter Pitts started building the
basics of neural networks.
o The 1950s brought us modern computers, letting scientists dig into machine
intelligence. Alan Turing's Turing test became a big deal in computer smarts. The
term "artificial intelligence" was first used in a 1956 Dartmouth College
meeting, where they introduced the first AI program, the Logic Theorist.
o The following years had good times and bad times for AI, called "AI Winters." In the
1970s and 1980s, we hit limits with computer power and complexity. But in the late
1990s, things got exciting again. Computers were faster, and there was more
data. IBM's Deep Blue beating chess champion Garry Kasparov in 1997 was a big
moment.
o The 2000s started a new era with machine learning, language processing, and
computer vision. This led to cool new products and services. The 2010s saw AI take
off with things like voice assistants and self-driving cars. Generative AI, which makes
creative stuff, also started getting big.
o In the 2020s, generative AI like ChatGPT-3 and Google's Bard grabbed everyone's
attention. These models can create all sorts of new things when you give them a
prompt, like essays or art. But remember, this tech is still new, and there are things
to fix, like making sure it doesn't make things up.

What Comprises to Artificial Intelligence?


Artificial Intelligence is not just a part of computer science even it's so vast and requires lots
of other factors which can contribute to it. To create the AI first we should know that how
intelligence is composed, so the Intelligence is an intangible part of our brain which 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:

o Mathematics
o Biology
o Psychology
o Sociology
o Computer Science
o Neurons Study
o Statistics
Types of Artificial Intelligence
Artificial Intelligence can be categorized in several ways, primarily based on two main
criteria: capabilities and functionality.

AI Type 1: Based on Capabilities


1. Weak AI or Narrow AI: Narrow AI, also known as Weak AI, is like a specialist in the
world of Artificial Intelligence. Imagine it as a virtual expert dedicated to performing
one specific task with intelligence. For example, think of Apple's Siri. It's pretty smart
when it comes to voice commands and answering questions, but it doesn't
understand or do much beyond that. Narrow AI operates within strict limits, and if
you ask it to step outside its comfort zone, it might not perform as expected. This
type of AI is everywhere in today's world, from self-driving cars to image recognition
on your smartphone.BM's Watson is another example of Narrow AI. It's a
supercomputer that combines Expert Systems, Machine Learning, and Natural
Language Processing, but it's still a specialist. It's excellent at crunching data and
providing insights but doesn't venture far beyond its defined tasks.
2. General AI: General AI, often referred to as Strong AI, is like the holy grail of
artificial intelligence. Picture it as a system that could do any intellectual task with
the efficiency of a human. General AI aims to create machines that think and learn
like humans, but here's the catch: there's no such system in existence yet.
Researchers worldwide are working diligently to make it a reality, but it's a complex
journey that will require significant time and effort.
3. Super AI: Super AI takes AI to another level entirely. It's the pinnacle of machine
intelligence, where machines surpass human capabilities in every cognitive aspect.
These machines can think, reason, solve puzzles, make judgments, plan, learn, and
communicate independently. However, it's important to note that Super AI is
currently a hypothetical concept. Achieving such a level of artificial intelligence would
be nothing short of revolutionary, and it's a challenge that's still on the horizon.

AI Type 2: Based on Functionality


1. Reactive Machines: Reactive Machines represent the most basic form of Artificial
Intelligence. These machines live in the present moment and don't have memories or
past experiences to guide their actions. They focus solely on the current scenario and
respond with the best possible action based on their programming. An example of a
reactive machine is IBM's Deep Blue, the chess-playing computer, and Google's
AlphaGo, which excels at the ancient game of Go.
2. Limited Memory: Limited Memory machines can remember some past experiences
or data but only for a short period. They use this stored information to make
decisions and navigate situations. A great example of this type of AI is seen in self-
driving cars. These vehicles store recent data like the speed of nearby cars,
distances, and speed limits to safely navigate the road.
3. Theory of Mind: Theory of Mind AI is still in the realm of research and development.
These AI systems aim to understand human emotions and beliefs and engage in
social interactions much like humans. While this type of AI hasn't fully materialized
yet, researchers are making significant strides toward creating machines that can
understand and interact with humans on a deeper, more emotional level.
4. Self-Awareness: Self-Awareness AI is the future frontier of Artificial Intelligence.
These machines will be extraordinarily intelligent, possessing their own
consciousness, emotions, and self-awareness. They'll be smarter than the human
mind itself. However, it's crucial to note that Self-Awareness AI remains a
hypothetical concept and does not yet exist in reality. Achieving this level of AI would
be a monumental leap in technology and understanding.

Advantages of Artificial Intelligence


Following are some main advantages of Artificial Intelligence:
o 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.
o 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.
o High reliability: AI machines are highly reliable and can perform the same action
multiple times with high accuracy.
o 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.
o 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.
o 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.
o Enhanced Security: AI can be very helpful in enhancing security, as It can detect
and respond to cyber threats in real time, helping companies protect their data and
systems.
o Aid in Research: AI is very helpful in the research field as it assists researchers by
processing and analyzing large datasets, accelerating discoveries in fields such as
astronomy, genomics, and materials science.

Disadvantages of Artificial Intelligence


Every technology has some disadvantages, and thesame 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:

o High Cost: The hardware and software requirement of AI is very costly as it requires
lots of maintenance to meet current world requirements.
o 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.
o 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.
o Increase dependency on machines: With the increment of technology, people are
getting more dependent on devices and hence they are losing their mental
capabilities.
o 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.
o Complexity: Making and keeping AI systems can be very complicated and
need a lot of knowledge. This can make it hard for some groups or people to
use them.
o Job Concerns: As AI gets better, it might take away not just basic jobs but
also some skilled ones. This worries people about losing jobs in different fields.

Challenges of AI
Artificial Intelligence offers incredible advantages, but it also presents some
challenges that need to be addressed:

o Doing the Right Thing: AI should make the right choices, but sometimes it
doesn't. It can make mistakes or do things that aren't fair. We need to teach
AI to be better at making good choices.
o Government and AI: Sometimes, governments use AI to keep an eye on
people. This can be a problem for our freedom. We need to make sure they
use AI in a good way.
o Bias in AI: AI can sometimes be a bit unfair, especially when it comes to
recognizing people's faces. This can cause problems, especially for people
who aren't like the majority.
o AI and Social Media: What you see on social media is often decided by AI.
But sometimes, AI shows things that aren't true or are kind of mean. We need
to make sure AI shows the right stuff.
o Legal and Regulatory Challenges: The rapid evolution of AI has outpaced
the development of comprehensive laws and regulations, leading to
uncertainty about issues like liability and responsibility.

AI Tools and Services


AI tools and services are advancing quickly, and this progress can be linked back to a
significant moment in 2012 when the AlexNet neural network came onto the scene.
This marked the start of a new era for high-performance AI, thanks to the use of
GPUs and massive data sets. The big shift was the ability to train neural networks
using huge amounts of data on multiple GPU cores simultaneously, making it a more
scalable process.

o Transformers: Google found a better way to train AI using lots of regular


computers with special chips called GPUs. This discovery made transformers
possible. Transformers help AI learn from data that doesn't have labels, like
teaching a computer to understand language.
o Hardware Improvements: Companies like Nvidia improved the inner
workings of these GPUs. They made them really good at handling the math AI
needs to do. This teamwork between better hardware, smarter AI software,
and computer data centers made AI a million times better! Nvidia is also
working with companies that offer cloud computing to make it easier for
others to use this powerful AI.
o GPTs: Before, if a company wanted to use AI, they had to start from scratch,
which was expensive and time-consuming. Now, companies like OpenAI,
Nvidia, Microsoft, and Google offer pre-trained AI models. These models can
be fine-tuned for specific tasks at a lower cost and with less effort. It's like
buying a ready-made cake and adding your own frosting instead of baking the
whole cake from scratch. This helps companies use AI faster and with less
risk.
o AI in the Cloud: Using AI can be tricky because it needs lots of data work.
Big cloud companies like AWS, Google, Microsoft, IBM, and Oracle are
making it easier. They're offering AI services that help with the hard parts, like
getting data ready, building AI models, and putting them into apps.
o Advanced AI for Everyone: Some groups are making really smart AI models
and sharing them. OpenAI, for example, has models that are good at
chatting, understanding language, making images, and writing code. Nvidia is
another, and they're not tied to one cloud company. Many others are making
special AI models for different jobs and industries. It's like having a library of
powerful tools for lots of different tasks.

Agents in Artificial Intelligence


An AI system can be defined as the study of the rational agent and its environment. The
agents sense the environment through sensors and act on their environment through
actuators. An AI agent can have mental properties such as knowledge, belief, intention, etc.

What is an Agent?
An agent can be anything that perceiveits environment through sensors and act upon that
environment through actuators. An Agent runs in the cycle of perceiving, thinking,
and acting. An agent can be:

o Human-Agent: A human agent has eyes, ears, and other organs which work for
sensors and hand, legs, vocal tract work for actuators.
o Robotic Agent: A robotic agent can have cameras, infrared range finder, NLP for
sensors and various motors for actuators.
o Software Agent: Software agent can have keystrokes, file contents as sensory
input and act on those inputs and display output on the screen.

Hence the world around us is full of agents such as thermostat, cellphone, camera, and even
we are also agents.

Before moving forward, we should first know about sensors, effectors, and actuators.

Sensor: Sensor is a device which detects the change in the environment and sends the
information to other electronic devices. An agent observes its environment through sensors.

Actuators: Actuators are the component of machines that converts energy into motion. The
actuators are only responsible for moving and controlling a system. An actuator can be an
electric motor, gears, rails, etc.

Effectors: Effectors are the devices which affect the environment. Effectors can be legs,
wheels, arms, fingers, wings, fins, and display screen.

Intelligent Agents:
An intelligent agent is an autonomous entity which act upon an environment using sensors
and actuators for achieving goals. An intelligent agent may learn from the environment to
achieve their goals. A thermostat is an example of an intelligent agent.

Following are the main four rules for an AI agent:

o Rule 1: An AI agent must have the ability to perceive the environment.


o Rule 2: The observation must be used to make decisions.
o Rule 3: Decision should result in an action.
o Rule 4: The action taken by an AI agent must be a rational action.

Rational Agent:
A rational agent is an agent which has clear preference, models uncertainty, and acts in a
way to maximize its performance measure with all possible actions.

A rational agent is said to perform the right things. AI is about creating rational agents to
use for game theory and decision theory for various real-world scenarios.

For an AI agent, the rational action is most important because in AI reinforcement learning
algorithm, for each best possible action, agent gets the positive reward and for each wrong
action, an agent gets a negative reward.

Rationality:

The rationality of an agent is measured by its performance measure. Rationality can be


judged on the basis of following points:

o Performance measure which defines the success criterion.


o Agent prior knowledge of its environment.
o Best possible actions that an agent can perform.
o The sequence of percepts.

Note: Rationality differs from Omniscience because an Omniscient agent knows the actual outcome of its
action and act accordingly, which is not possible in reality.

Structure of an AI Agent
The task of AI is to design an agent program which implements the agent function. The
structure of an intelligent agent is a combination of architecture and agent program. It can
be viewed as:

1. Agent = Architecture + Agent program

Following are the main three terms involved in the structure of an AI agent:

Architecture: Architecture is machinery that an AI agent executes on.

Agent Function: Agent function is used to map a percept to an action.

1. f:P* → A

Agent program: Agent program is an implementation of agent function. An agent program


executes on the physical architecture to produce function f.

PEAS Representation
PEAS is a type of model on which an AI agent works upon. When we define an AI agent or
rational agent, then we can group its properties under PEAS representation model. It is
made up of four words:
o P: Performance measure
o E: Environment
o A: Actuators
o S: Sensors

Here performance measure is the objective for the success of an agent's behavior.

PEAS for self-driving cars:

Let's suppose a self-driving car then PEAS representation will be:

Performance: Safety, time, legal drive, comfort

Environment: Roads, other vehicles, road signs, pedestrian

Actuators: Steering, accelerator, brake, signal, horn

Sensors: Camera, GPS, speedometer, odometer, accelerometer, sonar.

Problem-solving

Search Algorithms in Artificial Intelligence


Search algorithms are one of the most important areas of Artificial Intelligence. This topic
will explain all about the search algorithms in AI.
Problem-solving agents:

In Artificial Intelligence, Search techniques are universal problem-solving methods. Rational


agents or Problem-solving agents in AI mostly used these search strategies or
algorithms to solve a specific problem and provide the best result. Problem-solving agents
are the goal-based agents and use atomic representation. In this topic, we will learn various
problem-solving search algorithms.

Search Algorithm Terminologies:


o Search: Searching is a step by step procedure to solve a search-problem in a given
search space. A search problem can have three main factors:

a. Search Space: Search space represents a set of possible solutions, which a


system may have.
b. Start State: It is a state from where agent begins the search.
c. Goal test: It is a function which observe the current state and returns
whether the goal state is achieved or not.
Search tree: A tree representation of search problem is called Search tree. The root
of the search tree is the root node which is corresponding to the initial state.
Actions: It gives the description of all the available actions to the agent.
Transition model: A description of what each action do, can be represented as a
transition model.
Path Cost: It is a function which assigns a numeric cost to each path.
Solution: It is an action sequence which leads from the start node to the goal node.
Optimal Solution: If a solution has the lowest cost among all solutions.

Properties of Search Algorithms:


Following are the four essential properties of search algorithms to compare the efficiency of
these algorithms:

Completeness: A search algorithm is said to be complete if it guarantees to return a


solution if at least any solution exists for any random input.

Optimality: If a solution found for an algorithm is guaranteed to be the best solution


(lowest path cost) among all other solutions, then such a solution for is said to be an optimal
solution.

Time Complexity: Time complexity is a measure of time for an algorithm to complete its
task.

Space Complexity: It is the maximum storage space required at any point during the
search, as the complexity of the problem.
Types of search algorithms
Based on the search problems we can classify the search algorithms into
uninformed (Blind search) search and informed search (Heuristic search)
algorithms.

Uninformed/Blind Search:

The uninformed search does not contain any domain knowledge such as closeness, the
location of the goal. It operates in a brute-force way as it only includes information about
how to traverse the tree and how to identify leaf and goal nodes. Uninformed search applies
a way in which search tree is searched without any information about the search space like
initial state operators and test for the goal, so it is also called blind search. It examines each
node of the tree until it achieves the goal node.

It can be divided into five main types:

o Breadth-first search
o Uniform cost search
o Depth-first search
o Iterative deepening depth-first search
o Bidirectional Search

Informed Search

Informed search algorithms use domain knowledge. In an informed search, problem


information is available which can guide the search. Informed search strategies can find a
solution more efficiently than an uninformed search strategy. Informed search is also called
a Heuristic search.

A heuristic is a way which might not always be guaranteed for best solutions but guaranteed
to find a good solution in reasonable time.

Informed search can solve much complex problem which could not be solved in another
way.

An example of informed search algorithms is a traveling salesman problem.

1. Greedy Search
2. A* Search

You might also like