Unit I Introduction To Artificial Intelligence
Unit I Introduction To Artificial Intelligence
When machines mimic humans intelligence and can make their own decisions, think, and
learn, then they are said to be artificially intelligent.
Machines are programmed about what to think. But in the case of machine learning,
machines are made to analyze, read data, observe and learn from their mistakes.
It has already left its mark on several Industries like manufacturing, retail, finance,
healthcare, e-commerce industries where businesses think they have fully utilized the
potential that AI carries. But in reality, is it still the tip of the iceberg.
The huge amount of data that we generate every day digitally has further helped with the
rapid growth of artificial intelligence. Making the machine faster and more efficient for
businesses and consumers alike. These intelligent machines not only try to mimic human-like
thinking but over time learns to do new operations as well.
As the hype around AI has accelerated, vendors have been scrambling to promote how their
products and services use it. Often, what they refer to as AI is simply a component of the
technology, such as machine learning. AI requires a foundation of specialized hardware and
software for writing and training machine learning algorithms. No single programming
language is synonymous with AI, but Python, R, Java, C++ and Julia have features popular
with AI developers.
In general, AI systems work by ingesting large amounts of labeled training data, analyzing
the data for correlations and patterns, and using these patterns to make predictions about
future states. In this way, a chatbot that is fed examples of text can learn to generate lifelike
exchanges with people, or an image recognition tool can learn to identify and describe objects
in images by reviewing millions of examples. New, rapidly improving generative AI
techniques can create realistic text, images, music and other media.
AI programming focuses on cognitive skills that include the following:
AI, machine learning and deep learning are common terms in enterprise IT and sometimes
used interchangeably, especially by companies in their marketing materials. But there are
distinctions. The term AI, coined in the 1950s, refers to the simulation of human intelligence
by machines. It covers an ever-changing set of capabilities as new technologies are
developed. Technologies that come under the umbrella of AI include machine learning and
deep learning.
Below we are going to read about the huge importance of Artificial Intelligence:
Artificial Intelligence's importance and subsequent components have been known for
a long time. They are being seen as tools and techniques to make this world better.
And it's not like you have to go through to be able to use these fancy tech gadgets.
You can look around, and I'm sure most of your work is smoothed out by artificial
intelligence.
Its importance lies in making our life easier. These technologies are a great asset to
humans and are programmed to minimize human effort as much as possible. They can
operate in an automated fashion. Therefore, manual intervention is the last thing that
can be sought or seen during the operation of parts involving this technology.
These machines speed up your tasks and processes with guaranteed accuracy and
precision, making them a useful and valuable tool. Apart from making the world an
error-free place with their simple and everyday techniques, these technologies and
applications are not only related to our ordinary and everyday life. It is affecting and
holds importance for other domains as well.
Top 4 Uses of Artificial Intelligence
1. In Medical Science
Artificial Intelligence has made an unprecedented impact in the medical industry and
hence changed the face of the medical industry. Various machine learning algorithms
and models have efficiently predicted various important use cases, such as
determining whether a particular patient has malignant or benign cancer or tumor
based on symptoms, health records, and history. It is also being used in future
predictions where patients are well informed about their deteriorating health and what
they should do to return to a normal and healthy life.
Artificial intelligence has created a virtual care private assistant specifically built for
people's needs. It is widely used to monitor, research different types of cases, and
analyze past cases and their outcomes. It also seeks to improve their model's and
assistants' efficiency by predicting what could be improved and making themselves
smarter.
The use of healthcare bots is another efficient move taken by the medical industry to
work their way up in medicine, which is known to provide 24/7 assistance and take up
the less important work of managing appointments. It has not have been possible
without the intervention of these smart artificial intelligence-based machines.
One of the major systematic transport in the world is air transport, and there has
become an urgent need to optimize their mode of operation. Here came the
involvement of Artificial Intelligence, where the machine is involved in planning the
routes along with the flight landing and take-off charts.
Artificial intelligence has been used in many aircraft, navigation maps, taxing routes,
and a quick examination of the entire cockpit panel to ensure the correct operation of
each component. Hence, it gives very promising results and is being adopted very
frequently. The ultimate aim of artificial intelligence in air transport is to give easier
and more comfortable travel to human beings.
AI will not be sold as an individual product. Instead, your products will be enhanced
with AI integration, like the Apple products discussed with the Siri feature.
Chatbots, automation, and smart devices, combined with massive amounts of data,
can improve many technologies at home and in the workplace.
With big data and computing power, it has become possible to develop fraud
detection systems that were nearly impossible just a few years ago.
It would help if you had a lot of data to train deep learning models because they learn
directly from the data. The more data, the more accurate they are.
It would help if you implemented AI to get answers from the data. The role of data is more
important than ever; Its gives you an edge over your competitors if you have the best data
system in this competitive industry because the best data will win!
In this chapter, we will focus logic programming and how it helps in Artificial Intelligence.
We already know that logic is the study of principles of correct reasoning or in simple words
it is the study of what comes after what. For example, if two statements are true then we can
infer any third statement from it.
Concept
Logic Programming is the combination of two words, logic and programming. Logic
Programming is a programming paradigm in which the problems are expressed as facts and
rules by program statements but within a system of formal logic. Just like other programming
paradigms like object oriented, functional, declarative, and procedural, etc., it is also a
particular way to approach programming.
Logic Programming uses facts and rules for solving the problem. That is why they are called
the building blocks of Logic Programming. A goal needs to be specified for every program in
logic programming. To understand how a problem can be solved in logic programming, we
need to know about the building blocks − Facts and Rules −
Facts
Actually, every logic program needs facts to work with so that it can achieve the given goal.
Facts basically are true statements about the program and data. For example, Delhi is the
capital of India.
Rules
Actually, rules are the constraints which allow us to make conclusions about the problem
domain. Rules basically written as logical clauses to express various facts. For example, if we
are building any game then all the rules must be defined.
Rules are very important to solve any problem in Logic Programming. Rules are basically
logical conclusion which can express the facts. Following is the syntax of rule −
A∶− B1,B2,...,Bn.
This can be read as, for every X and Y, if X is the father of Y and Y is an ancestor of Z, X is
the ancestor of Z. For every X and Y, X is the ancestor of Z, if X is the father of Y and Y is
an ancestor of Z.
For starting logic programming in Python, we need to install the following two packages −
Kanren
It provides us a way to simplify the way we made code for business logic. It lets us express
the logic in terms of rules and facts. The following command will help you install kanren −
Actually we can find the unknown values by using logic programming in a very effective
way. The following Python code will help you match a mathematical expression −
add = 'add'
mul = 'mul'
Both addition and multiplication are communicative processes. Hence, we need to specify it
and this can be done as follows −
fact(commutative, mul)
fact(commutative, add)
fact(associative, mul)
fact(associative, add)
a, b = var('a'), var('b')
We need to match the expression with the original pattern. We have the following original
pattern, which is basically (5+a)*b −
Original_pattern = (mul, (add, 5, a), b)
We have the following two expressions to match with the original pattern −
((3,2))
()
The first output represents the values for a and b. The first expression matched the original
pattern and returned the values for a and b but the second expression did not match the
original pattern hence nothing has been returned.
With the help of logic programming, we can find the prime numbers from a list of numbers
and can also generate prime numbers. The Python code given below will find the prime
number from a list of numbers and will also generate the first 10 prime numbers.
Now, we will define a function called prime_check which will check the prime numbers
based on the given numbers as data.
def prime_check(x):
if isvar(x):
return condeseq([(eq,x,p)] for p in map(prime, it.count(1)))
else:
return success if isprime(x) else fail
x = var()
print((set(run(0,x,(membero,x,(12,14,15,19,20,21,22,23,29,30,41,44,52,62,65,85)),
(prime_check,x)))))
print((run(10,x,prime_check(x))))
The output of the above code will be as follows −
Logic programming can be used to solve many problems like 8-puzzles, Zebra puzzle,
Sudoku, N-queen, etc. Here we are taking an example of a variant of Zebra puzzle which is as
follows −
We are solving it for the question who owns zebra with the help of Python.
Now, we need to define two functions − left() and next() to check whose house is left or next
to who’s house −
houses = var()
We need to define the rules with the help of lall package as follows.
There are 5 houses −
rules_zebraproblem = lall(
(eq, (var(), var(), var(), var(), var()), houses),
With the help of the following code, we can extract the output from the solver −
In summary, heuristic search techniques and constraint satisfaction problems are both
important tools in the AI toolkit for solving complex problems efficiently. They are often
used together to tackle real-world challenges across various domains.
In summary, both local search techniques and greedy search are valuable approaches in
problem-solving and optimization, each with its strengths and weaknesses. They are
particularly useful in situations where exhaustive search is infeasible or impractical.
However, careful consideration must be given to the problem characteristics and algorithm
properties to ensure effective and efficient solution finding.