Professional Documents
Culture Documents
AI - (Sangida Akter) (ID-11608019) .
AI - (Sangida Akter) (ID-11608019) .
AI - (Sangida Akter) (ID-11608019) .
Of
Computer Science & Engineering
Assignment On
Course Code : CSE-4101
Course Title : Artificial Intelligence
Submitted to:
Chowdhury Shahriar Muzammel
Lecturer
Dept.of CSE
Comilla University
Submitted by:
SangidaAkter
ID :11608019
Session : 2015-16
Dept.of CSE
Comilla University
(a) “AI lacks of creative responses that human experts are capable of”-is the statement
true. Justify your answer.
(b) Define the term Artificial Intelligence (AI).How can you organize the definitions of
Artificial Intelligence (AI) along two dimensions and into four categories?
(c) To what extend the following computer systems are the instances of AI:
(a)
“AI lacks of human responses that human experts are capable of” – the given statement
is true.
AI or artificial intelligence is the study and design of computing systems that perceives
its environment and takes actions like human beings. Though AI has revolutionized in
many areas, but still it has not reach the human level of excellence. The lacking it has is
given below:
(b)
Artificial Intelligence (AI) : The study and design of computing systems that
perceives its environment and takes actions like human beings.
There are two ways in which AI is generally classified. One type is based on classifying
AI and AI-enabled machines based on their likeness to the human mind, and their
ability to “think” and perhaps even “feel” like humans. Another measurement is
rationality. A system is rational if it does the “right thing,” given what it knows.
According to this system of classification, there are four types of AI or AI-based
systems.
These search engines retrieve pages using various techniques which might be
intelligent. For ex, auto correct feature that uses Data mining based on grasping the
user’s corrections of their own spelling errors. It may seems like a very big effort need
to be put up by humans, but with the processing powers of computers it is just way too
normal task. The intelligence required isn’t high though. Indexing huge amounts of
pages to get them in a fraction of a second is a problem in DB design and not Artificial
Intelligence.
Voice –activated telephone menus is similar to Web search engines. For ex: I say “OK
Google” and “Call XYZ“. The software is programmed to recognize the key words like
“OK google, Call” etc, and calls the XYZ person by looking up in the directory. If
phone-book has multiple entries then it asks us which contact to call. Voice recognition
is a part of AI systems but not completely AI. It’s almost predefined. It looks like AI but
it’s not. Same is the case with IVR options provided by telephone companies too.
(a) Define agent and rational agent. What are the things based on what rationality can
be defined?
(b) Describe the components to formularize a problem. Give standard formulation for
crossword puzzle problem.
(c) What are the criteria to evaluate an algorithm? Write short note on utility based
agent.
(a)
Agent: An agent is anything that can be viewed as perceiving its environment
through sensors & acting upon that environment through actuators.
Rational Agent: For each possible percept sequence, a rational agent should
select an action that is expected to maximize its performance measure, given the
evidence provided by the percept sequence and whatever built-in knowledge the
agent has.
There are four things which are defined Rationality:
(b)
States
Actions
Goal test
Path cost
The standard formulization for crossword puzzled problem is
given below:
(c)
The criteria to evaluate an algorithm are given below:
Completeness
Time
Space
Optimality
There are a short description on Utility Based Agent:
These agents are similar to the goal-based agent but provide an
extra component of utility measurement which makes them
different by providing a measure of success at a given state.
Utility-based agent act based not only goals but also the best way to
achieve the goal.
The Utility-based agent is useful when there are multiple possible
alternatives, and an agent has to choose in order to perform the best
action.
The utility function maps each state to a real number to check how
efficiently each action achieves the goals.
Figure: Utility Based Agent
(d)
Below is explained Depth First Search with example:
Depth-first search is a recursive algorithm for traversing a tree or graph data
structure.
It is called the depth-first search because it starts from the root node and
follows each path to its greatest depth node before moving to the next path.
DFS uses a stack data structure for its implementation.
Example:
In the below search tree, we have shown the flow of depth-first search, and it will
follow the order as:
It will start searching from root node S, and traverse A, then B, then D and E, after
traversing E, it will backtrack the tree as E has no other successor and still goal node is
not found. After backtracking it will traverse node C and then G, and here it will
terminate as it found goal node
Figure: Depth First Search
Completeness: DFS search algorithm is complete within finite state space as it will
expand every node within a limited search tree.
Time Complexity: Time complexity of DFS will be equivalent to the node traversed by
the algorithm. It is given by:
Where, m= maximum depth of any node and this can be much larger than d
(Shallowest solution depth)
Space Complexity: DFS algorithm needs to store only single path from the root node,
hence space complexity of DFS is equivalent to the size of the fringe set, which is
O(bm).
(a) How does Greedy Best First Search work? Does Greedy Best First Search always
guarantee to find the optimal solution?-Justify with your own words.
(b) What are the problems of Hill-climbing search? How to deal these problems? Explain
with necessary figure.
(c) Consider a tree having b=3,d=2.Now prove that DFS has Max-list-length : 1+d(b-1).
(a)
Greedy Best First Search:
Greedy best-first search algorithm always selects the path which appears best at that
moment. It is the combination of depth-first search and breadth-first search algorithms.
It uses the heuristic function and search. Best-first search allows us to take the
advantages of both algorithms. With the help of best-first search, at each step, we can
choose the most promising node. In the best first search algorithm, we expand the node
which is closest to the goal node and the closest cost is estimated by heuristic function,
i.e.
f(n) = g(n).
Example:
Consider the below search problem, and we will traverse it using greedy best-first
search. At each iteration, each node is expanded using evaluation function f(n)=h(n) ,
which is given in the below table.
.
In this search example, we are using two lists which are OPEN and CLOSED Lists.
Following are the iteration for traversing the above example:
Figure: Greedy Best First Search
Time Complexity: The worst case time complexity of Greedy best first search is O(bm).
Space Complexity: The worst case space complexity of Greedy best first search is
O(bm).Where, m is the maximum depth of the search space.
Complete: Greedy best-first search is also incomplete, even if the given state space is
finite.
(b)
Hill climbing algorithm is a local search algorithm which continuously moves in the
direction of increasing elevation/value to find the peak of the mountain or best solution
to the problem. It terminates when it reaches a peak value where no neighbor has a
higher value. It is a technique which is used for optimizing the mathematical problems.
One of the widely discussed examples of Hill climbing algorithm is Traveling-salesman
Problem in which we need to minimize the distance traveled by the salesman. It is also
called greedy local search as it only looks to its good immediate neighbor state and not
beyond that. A node of hill climbing algorithm has two components which are state and
value. Hill Climbing is mostly used when a good heuristic is available. In this
algorithm, we don't need to maintain and handle the search tree or graph as it only
keeps a single current state.
1. Local Maximum: A local maximum is a peak state in the landscape which is better
than each of its neighboring states, but there is another state also present which is
higher than the local maximum.
Solution: Backtracking technique can be a solution of the local maximum in state space
landscape. Create a list of the promising path so that the algorithm can backtrack the
search space and explore other paths as well.
2. Plateau: A plateau is the flat area of the search space in which all the neighbor states
of the current state contains the same value, because of this algorithm does not find any
best direction to move. A hill-climbing search might be lost in the plateau area.
Solution: The solution for the plateau is to take big steps or very little steps while
searching, to solve the problem. Randomly select a state which is far away from the
current state so it is possible that the algorithm could find non-plateau region.
3. Ridges: A ridge is a special form of the local maximum. It has an area which is higher
than its surrounding areas, but itself has a slope, and cannot be reached in a single
move.
(c)
Depth-first Search
n1 n2
n3
Visited List
i n1 n2 n3
n12 n13 n2 n3
n13 n2 n3
n22 n23 n3
Visited List
n23 n3
n32 n33
n33 empty
(a) Define Unification. Unify these two expressions : (1) P(x, f(y)) , (2) P(a, f(g(z)))
(b) Given facts:
i. All people who are graduating are happy.
ii. All happy people smile.
iii. Someone is graduating.
(a)
Unification:
Unification is all about making the expressions look identical. So for the both
above expressions to make them look identical we need to be substitution.
Formal notation for substitution we still use substitution x with a in expression
(1), So it is represented as a for x, i.e a/x and also g(z)/y.
With both the substitution we can make expression (1) look like expression(2).
We get, [a/x, g(z)/y]
(b)
Facts:
Step-1:
i. ∀x : Grade(x)-----happy(x)
ii. ∀x : happy(x)-----smile(x)
iii. ∃x : Grade(x)
iv. ∃x : smile(x)
Step-2:
a)
i. ∀x : ¬ Grade(x) ∨ happy(x)
ii. ∀x : ¬happy(x) ∨ smile(x)
iii. ∃x : Grade(x)
iv. ∃x : smile(x)
b)
i. ∀x : ¬ Grade(x) ∨ happy(x)
i. ∀y : happy(y) ∨ smile(y)
ii. ∃z : Grade(z)
iii. ∃x : smile(w)
c)
i. ∀x : ¬ Grade(x) ∨ happy(x)
ii. ∀y : ¬happy(y) ∨ smile(y)
iii. ∃x : Grade(A)
iv. ∃x : smile(V)
d)
i. ¬ Grade(x) ∨ happy(x)
ii. ¬happy(y) ∨ smile(y)
iii. Grade(A)
iv. smile(V)
Step-3: ¬ smile(V)
Step-4: ¬ smile(V)
¬happy(y)
¬ Grade(V)
(c)
i. All Pompeian's were Roman: ∀x: Pompeian(x)→ Roman (x)
ii. Caesar was a ruler: ruler (Caesar)
iii. All Romans were either loyal to Caesar or hated him: ∀x : Roman (x)→ loyal to (x,
Caesar) ∨ hate (x, Caesar)
iv. Everyone is loyal to someone: ∀x ∃y: loyal to (x, y)
v. People only try to assassinate rulers they are not loyal to: ∀x ∃y: Person (x) ∧ ruler
(y) ∧ tryassassinate(x, y)→ ¬ loyalto(x, y)
Question no-7
(a)Define artificial neural network. Briefly describe different layers of ANN with
appropriate figure.
(a)
Artificial neuron network: An artificial neuron network (ANN) is a computational
model based on the structure and functions of biological neural networks.
Dr. Robert Hecht-Nielsen defines a neural network as:“...a computing system made up
of a number of simple, highly interconnected processing elements, which process
information by their dynamic state response to external inputs.”
Information that flows through the network affects the structure of the ANN because a
neural network changes - or learns, in a sense - based on that input and output. It is like
an artificial human nervous system for receiving, processing, and transmitting
information in terms of Computer Science.
ANNs are considered nonlinear statistical data modeling tools where the complex
relationships between inputs and outputs are modeled or patterns are found. The
inventor of one of the first neurocomputers.
1. Input Layer
2. Hidden Layers
3. Output Layer
Figure .Artificial neural network
1) Input layer: The Input layer communicates with the external environment that
presents a pattern to the neural network. Its job is to deal with all the inputs only. This
input gets transferred to the hidden layers which are explained below. The input layer
should represent the condition for which we are training the neural network. Every
input neuron should represent some independent variable that has an influence over
the output of the neural network
2) Hidden layer: The hidden layer is the collection of neurons which has activation
function applied on it and it is an intermediate layer found between the input layer and
the output layer. Its job is to process the inputs obtained by its previous layer. So it is
the layer which is responsible extracting the required features from the input data.
Many researches has been made in evaluating the number of neurons in the hidden
layer but still none of them was successful in finding the accurate result. Also there can
be multiple hidden layers in a Neural Network.
3) Output layer: The output layer of the neural network collects and transmits the
information accordingly in way it has been designed to give. The pattern presented by
the output layer can be directly traced back to the input layer. The number of neurons
in output layer should be directly related to the type of work that the neural network
was performing. To determine the number of neurons in the output layer, first consider
the intended use of the neural network.
Figure : Activation function for ANN
(b)
Supervised learning with appropriate figure is given below:
Supervised learning, in the context of artificial intelligence (AI) and machine learning, is
a type of system in which both input and desired output data are provided. Input and
output data are labelled for classification to provide a learning basis for future data
processing.
Supervised machine learning systems provide the learning algorithms with known
quantities to support future judgments. Chatbots, self-driving cars, facial recognition
programs, expert systems and robots are among the systems that may use either
supervised or unsupervised learning. Supervised learning systems are mostly
associated with retrieval-based AI but they may also be capable of using a generative
learning model.
Supervised learning models have some advantages over the unsupervised approach,
but they also have limitations. The systems are more likely to make judgments that
humans can relate to, for example, because humans have provided the basis for
decisions. However, in the case of a retrieval-based method, supervised learning
systems have trouble dealing with new information. If a system with categories for cars
and trucks is presented with a bicycle, for example, it would have to be incorrectly
lumped in one category or the other. If the AI system was generative, however, it may
not know what the bicycle is but would be able to recognize it as belonging to a
separate category.
(c)
Entailment: Entailment means that one thing follows from another. Entailment is a
relationship between sentences that is based on semantics.
KB ╞ α
Where,
KB=knowledge base
α is a sentence
Knowledge base (KB) entails sentence α if and only if α is true in all worlds where
KB is true
Example of entailment:
i. the KB containing “the Giants won” and “the Reds won” entails “Either the
Giants won or the Reds won”
ii. x+y = 4 entails 4 = x+y