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

Question 1

a) Explain the four goals of artificial intelligence. 8mks


To Implement Human Intelligence in Machines − Creating systems that understand, think,
learn, and behave like humans.
General AI goals.
 Replicate human intelligence
 Solve knowledge intensive tasks
 Make an intelligent connection between perception and action
 Enhance human-human, human-computer and computer to computer interaction /
communication.
b) With an example explain what is Turing test? 4mks

The Turing Test is a method of inquiry in artificial intelligence (AI) for determining whether or
not a computer is capable of thinking like a human being. The test is named after Alan Turing,
the founder of the Turing Test and an English computer scientist, cryptanalyst, mathematician
and theoretical biologist.

Turing proposed that a computer can be said to possess artificial intelligence if it can mimic
human responses under specific conditions. The original Turing Test requires three terminals,
each of which is physically separated from the other two. One terminal is operated by a
computer, while the other two are operated by humans.

During the test, one of the human functions as the questioner, while the second human and the
computer function as respondents. The questioner interrogates the respondents within a specific
subject area, using a specified format and context. After a preset length of time or number of
questions, the questioner is then asked to decide which respondent was human and which was a
computer.

Example;

 3 rooms contain; a person, a computer, and an interrogator


 The interrogator can communicate with the other 2 by teletype (to avoid the machine
imitate the appearance or voice of the person).
 The interrogator tries to determine which is the person and which is the machine
 The machine tries to fool the interrogator to believe that it is the human, and the person
also tries to convince the interrogator that it is the human.
 If the machine succeeds in fooling the interrogator, then conclude that the machine is
intelligent
c) Explain the techniques that makes systems to behave as “intelligent”. 8mks
Techniques include;
 Describe and match

In this technique, system’s behavior is explained in terms of a finite state model and computation
model.

Finite state model: It consists of a set of states, a set of input events and the relations between
them. Based on the current state and an input event, the next state of the model can be
determined.

Computation model: It is finite state machine which includes a set of states, a start state, a
transition function and an input alphabet. The transition function provides mapping between
input symbols and current state to next states.

 Constraint satisfaction

Constraint satisfaction is the process of generating solution that satisfies all the specified
constraints for a given problem. There is variable which needs to get assigned values from a
specific domain.

To generate the solution, it uses backtracking mechanism. The optimal solution is the one in
which is generated in minimum number of backtracks and satisfies all the constraints thereby
assigning proper values to each of the variable.

There are multiple fields having applications of constraint satisfaction. Artificial Intelligence.
Programming Languages, Symbolic Computing and computational logic are few of them to
name.

Example: N- queen problem, as in this problem the queens are the variables to whom a position
in an n*n Matrix need to be assigned which is a value for those variables. Also the problem
States some conditions on placement of those Queens that is no two queens can clash either
horizontally, vertically or diagonally.

 Generate and test

It is the simplest form of searching technique. Generate and test method first generate a node in
the search tree and then checks for whether it's goal node. It involves two processes as shown

1. Generate the successor node.


2. Test to match it with each of the proposed goal node.
As there are many unfruitful nodes gets generated during this process, it’s not a very efficient
technique. E.g.: Problem of opening a combination lock by trial-and-error technique without
knowing the combination.

 Goal reduction

In goal reduction technique, the main goal is divided into sub goals. It requires some procedures
to follow. Goal reduction procedures are an alternative to declarative and logic-based
representations.

Goal reduction process includes hierarchical sub division of goals into sub goals is carried out
until the sub goals have an immediate solution. An AND-OR tree/graph structure can represent
relations between goals and sub goals, alternative sub-goals and conjoint sub-goals.

There are different goal levels. Higher-level goals are higher in the tree, and lower level goals are
lower in the tree. There are directed arcs from a higher level to lower level nodes, representing
the reduction of higher level goal to lower level sub goals. Nodes are the leaf nodes of the tree.
These goals cannot be divided further.

Example: An AND/OR tree structure to represent facts such as “enjoyment”, “earning/save


money”, “old age” etc.

 Tree searching

Tree searching is a very commonly used technique to solve many problems. Goal reduction,
constraint networks are few of the areas. Tree is searched through many nodes to obtain the goal
node and it gives the path from source node to destination node.

If each node of the entire tree is explored while searching for the goal node, it is called as
exhaustive search. All the searching techniques of AI are broadly classified as uninformed
searching and informed searching.

Uninformed Searching Techniques

 Depth first Search


 Breadth first Search
 Uniform Cost Search
 Depth Limited Search
 Iterative Depending DFS
 Bidirectional Search

Informed Search Techniques


 Hill Climbing
 Best first search
 A* Search
 Iterative depending A*
 Beam Search
 AO* search.

 Rule based systems

Rule based system are the simplest and most useful systems. In its simplest form they have set of
rules, an interpreter and input from the environment. Rules are of the form IF<
Condition>THEN<action>.

Rule based system components are as follows:

1. Working memory or knowledge base: It stores the facts of the outside world that are
observed currently. It may take a form of a triplet <object ,attribute="" ,value="">. For
example: To represent the fact that “The color of my car is black”, the knowledgebase
will store<car, color="" black="">triplet.
2. Rule base: what will be the basic part of the system it contains all the rules rules are
generated from the domain knowledge and can be used for modification based on the
current observations.

For example: If <(temperature, over, 20)>

Then <add (ocean,="" swimabel,="" yes)&gt;<="" p="">

While using a particular rule, first the conditions are matched to the current observations and if
satisfied then, rule may be fired.

Biological-inspired AI Techniques:

 Neutral networks
 Reinforcement learning
 Genetic algorithms
Question 2
a) What is expert system? 2mks
In artificial intelligence, an expert system is a computer system emulating the decision-making
ability of a human expert. Expert systems are designed to solve complex problems by reasoning
through bodies of knowledge, represented mainly as if–then rules rather than through
conventional procedural code.
It enables the system to diagnose situations without the human expert being present.
Expert Systems Examples 

 There are numerous examples of expert systems. Some of them are:

 MYCIN: This was one of the earliest expert systems that was based on backward
chaining. It has the ability to identify various bacteria that cause severe infections. It is
also capable of recommending drugs based on a person’s weight.
 DENDRAL: This was an AI based expert system used essentially for chemical analysis.
It uses a substance’s spectrographic data in order to predict its molecular structure.
 R1/XCON: This ES had the ability to select specific software to generate a computer
system as per user preference.
 PXDES: This system could easily determine the type and the degree of lung cancer in
patients based on limited data.
 CaDet: This is a clinical support system that identifies cancer in early stages.
 DXplain: This is also a clinical support system that is capable of suggesting a variety of
diseases based on just the findings of the doctor

b) Explain the two ways of building an expert system. 4mks

The process of Building An Expert Systems

 Determining the characteristics of the problem


 Knowledge engineer and domain expert work in coherence to define the problem
 The knowledge engineer translates the knowledge into a computer-understandable
language. He designs an inference engine, a reasoning structure, which can use
knowledge when needed.
 Knowledge Expert also determines how to integrate the use of uncertain knowledge in
the reasoning process and what type of explanation would be useful.

c) With illustration, explain the components and human interfaces in ES (10mks)


d) Explain areas where Expert system is applicable. 4mks

Question 3
a) What is learning?
Learning is a process that improves the knowledge of an AI program by making observations about its
environment. Learning is the process of converting experience into expertise or knowledge.

b) With illustration explain the learning agent. 4mks

A learning agent in AI is the type of agent that can learn from its past experiences or it has
learning capabilities. It starts to act with basic knowledge and then is able to act and adapt
automatically through learning. 
A learning agent has mainly four conceptual components, which are: 

1. Learning element: It is responsible for making improvements by learning from the


environment 
2. Critic: The learning element takes feedback from critics which describes how well the
agent is doing with respect to a fixed performance standard.
3. Performance element: It is responsible for selecting external action
4. Problem Generator: This component is responsible for suggesting actions that will lead
to new and informative experiences.

A learning agent is able to act and adapt based on new information.

c) With illustrations explain the components of learning system. 4mks


d) Explain the paradigms of machine of learning. 7mks
e) Explain the types of learning in AI. 8mks

Learning can be broadly classified into four categories, as mentioned below, based on the nature
of the learning data and interaction between the learner and the environment.
 Supervised Learning
 Unsupervised Learning
 Semi-supervised Learning
 Reinforcement Learning
Supervised Learning

Supervised learning is commonly used in real world applications, such as face and speech
recognition, products or movie recommendations, and sales forecasting. Supervised learning can
be further classified into two types - Regression and Classification.

Regression trains on and predicts a continuous-valued response, for example predicting real
estate prices.

Classification attempts to find the appropriate class label, such as analyzing positive/negative
sentiment, male and female persons, benign and malignant tumors, secure and unsecure loans
etc.

In supervised learning, learning data comes with description, labels, targets or desired outputs
and the objective is to find a general rule that maps inputs to outputs. This kind of learning data
is called labeled data. The learned rule is then used to label new data with unknown outputs.

Unsupervised learning

Unsupervised learning is used to detect anomalies, outliers, such as fraud or defective equipment,
or to group customers with similar behaviours for a sales campaign. It is the opposite of
supervised learning. There is no labelled data here.

When learning data contains only some indications without any description or labels, it is up to
the coder or to the algorithm to find the structure of the underlying data, to discover hidden
patterns, or to determine how to describe the data. This kind of learning data is called unlabeled
data.

Suppose that we have a number of data points, and we want to classify them into several groups.
We may not exactly know what the criteria of classification would be. So, an unsupervised
learning algorithm tries to classify the given dataset into a certain number of groups in an
optimum way.

Semi-supervised Learning

If some learning samples are labeled, but some other are not labeled, then it is semi-supervised
learning. It makes use of a large amount of unlabeled data for training and a small amount of
labeled data for testing. Semi-supervised learning is applied in cases where it is expensive to
acquire a fully labeled dataset while more practical to label a small subset. For example, it often
requires skilled experts to label certain remote sensing images, and lots of field experiments to
locate oil at a particular location, while acquiring unlabeled data is relatively easy.
Reinforcement Learning

Here learning data gives feedback so that the system adjusts to dynamic conditions in order to
achieve a certain objective. The system evaluates its performance based on the feedback
responses and reacts accordingly. The best-known instances include self-driving cars and chess
master algorithm AlphaGo.

Question 4 answered
a) What is reasoning? 2mks
b) Explain the three areas in human reasoning capabilities. 6mks
c) With examples explain the different methods of reasoning. 9mks
d) List the different approaches to reasoning under uncertainty. 3mks

Question 5
a) Explain the different types of knowledge representation. 8mks
Knowledge: Knowledge is awareness or familiarity gained by experiences of facts, data, and
situations. Following are the types of knowledge in artificial intelligence:

Humans are best at understanding, reasoning, and interpreting knowledge. Human knows things,
which is knowledge and as per their knowledge they perform various actions in the real world.
But how machines do all these things comes under knowledge representation and
reasoning. Hence, we can describe Knowledge representation as following:

 It is responsible for representing information about the real world so that a computer can
understand and can utilize this knowledge to solve the complex real-world problems such
as diagnosis a medical condition or communicating with humans in natural language.
 It is also a way which describes how we can represent knowledge in artificial
intelligence. Knowledge representation is not just storing data into some database, but it
also enables an intelligent machine to learn from that knowledge and experiences so that
it can behave intelligently like a human.

Types of Knowledge Representation

 Declarative Knowledge
 Procedural Knowledge
 Meta Knowledge
 Heuristic Knowledge
 Structural Knowledge

Declarative Knowledge

 It is the segment of knowledge which stores factual information in a memory and it seem
to be static in nature.
 Declarative knowledge is to know about something.
 It includes concepts, facts, and objects.
 It is also called descriptive knowledge and expressed in declarative sentences.
 It is simpler than procedural language.

Procedural Knowledge

 It is also known as imperative knowledge.


 Procedural knowledge is a type of knowledge which is responsible for knowing how to
do something.
 It can be directly applied to any task.
 It includes rules, strategies, procedures, agendas, etc.
 Procedural knowledge depends on the task on which it can be applied.

Meta Knowledge

 In the field of AI, the knowledge of pre-defined knowledge is known as meta knowledge.
A study of planning, tagging and learning are some of the examples of meta knowledge.
This model tends to change with time and utilize a different specification. A knowledge
engineer may utilize different forms of meta-knowledge given below:
 Accuracy, Applicability, Assessment, Consistency, Completeness, Disambiguation,
Justification, Life Span, Purpose, Source, Reliability.

Heuristic Knowledge
 This knowledge is also known as Shallow knowledge and it follows the principle of
thumb rule.
 Heuristic knowledge is representing knowledge of some experts in a filed or subject.
 Heuristic knowledge is rules of thumb based on previous experiences, awareness of
approaches, and which are good to work but not guaranteed.

Structural Knowledge

 Structural knowledge is basic knowledge to problem-solving.


 It describes relationships between various concepts such as kind of, part of, and grouping
of something.
 It describes the relationship that exists between concepts or objects.

b) With illustration explain knowledge progression. 8mks


Knowledge is a progression that starts with data which is of limited utility.

By organizing or analyzing the data, we understand what the data means, An understanding of the
principles embodied within the knowledge is wisdom and this becomes information The interpretation
or evaluation of information yield knowledge.

An understanding of the principles embodied within the knowledge is wisdom.

Data is viewed as collection of disconnected facts.

Information emerges when relationships among facts are established and understood; Provides answers
to "who”, “what", "where", and "when".

Knowledge emerges when relationships among patterns are identified and understood; Provides
answers as "how".

Wisdom is the pinnacle of understanding, uncovers the principles of relationships that describe patterns.

c) Explain the two major categories of knowledge. 4mks


Categories of knowledge

Knowledge can be categorized into two major types:

 Tacit knowledge
 Explicit knowledge

Tacit knowledge is the knowledge which exists within a human being. It does correspond to
informal or implicit type of knowledge. It is quite difficult to articulate formally and is also
difficult to communicate and share.

Explicit knowledge is the knowledge which exists outside a human being. It corresponds to
formal type of knowledge. It is easier to articulate compared to tacit knowledge and is easier to
share, store or even process.

Question 7
a) What is artificial intelligence? 2mks
Artificial intelligence is the simulation of human intelligence processes by machines, especially
computer systems. Specific applications of AI include expert systems, natural language
processing, speech recognition and machine vision.
Types of AI

 Reactive Machines
 Limited Memory
 Theory of Mind
 Self-Awareness

Examples of AI

 Siri, Alexa and other smart assistants


 Self-driving cars
 Robo-advisors
 Conversational bots
 Email spam filters
 Netflix's recommendations

b) Explain 8 intelligence behavior. 9mks

Here are 14 intelligent behaviours, many of which were originally compiled by Arthur Costa
in a paper entitled, Teaching for Intelligence.

1.  Persistence:  not giving up when the answer to a problem is not immediately known. 

2.  Overcoming impulsiveness: planning, clarifying goals, exploring alternative strategies


and considering consequences before you begin.
3.  Listening to others: some cognitive psychologists think that the ability to listen to
another person and understand their point of view is one of the highest forms of intelligent
behavior.

4.  Flexibility in thinking: considering other points of view rather than running with the first
possibility.

5.  Metacognition--awareness of how you're thinking, knowing what's going on in your head
when you're thinking.

6.  Checking for accuracy and precision: not letting speed surpass your desire for
craftsmanship.

7.  Questioning and problem posing: asking questions and finding out problems for
yourself.

8.  Applying past knowledge to new situations: calling upon your store of knowledge and
experience as sources of data, theories to explain, or processes to solve each new challenge.

9.  Precision of language and thought: using more descriptive terms to distinguish objects,
and providing criteria for value judgments.

10.  Using all the senses--feeling, seeing, hearing, even tasting in order to more effectively
problem solve.

11.  Creativity--using ingenuity, originality and insight: developing the capacity to generate
original, clever or ingenious products, solutions and techniques.

12.  Living with a sense of wonderment, inquisitiveness and curiosity: openness to


beauty, intricacy, complexity and simplicity.

13.  Cooperation: taking advantage of the thinking and learning that can only come as a
result of social relationships.

14.  Sense of humour: able to look at situations, opportunities, problems and relationships
with nonchalance and fun.

c) Differentiate between hard and soft Artificial Intelligence. 4mks


Strong AI refers to a machine that approaches or supersedes human intelligence;
 If it can do typically human tasks
 If it can apply a wide range of background knowledge and
 If it has some degree of self-consciousness.
Strong AI aim to build machines whose overall intellectual ability is distinguishable from that of
a human being.
Weak/soft AI refers to the use of software to study or accomplish specific problem solving or
reasoning tasks that do not encompass the full range of human cognitive abilities. E.g., a chess
program such as Deep Blue
Weak AI does not achieve self-awareness, it demonstrates a wide range of human level cognitive
abilities; it is merely an intelligent, a specific problem solver.
Weak AI is also, an AI system that is designed and trained to complete a specific task. Industrial
robots and virtual personal assistants, such as Apple's Siri, use weak AI.
Other few examples of Narrow/weak AI include: 
 Google search
 Image recognition software
 Siri, Alexa and other personal assistants
 Self-driving cars

d) Explain at least six examples of tasks involving higher mental processing. 5mks

Question 8
a) Describe five disadvantages of rule-based expert systems. 10mks

A rule-based expert system is the simplest form of artificial intelligence and uses prescribed
knowledge-based rules to solve a problem.  The aim of the expert system is to take knowledge
from a human expert and convert this into a number of hardcoded rules to apply to the input data.

Disadvantages of rule based expert systems.

Opaque relations between rules. Although the individual production rules tend to be relatively
simple and self-documented, their logical interactions within the large set of rules may be
opaque. Rule-based systems make it difficult to observe how individual rules serve the overall
strategy. This problem is related to the lack of hierarchical knowledge representation in the rule-
based expert systems.

Ineffective search strategy. The inference engine applies an exhaustive search through all the
production rules during each cycle. Expert systems with a large set of rules (over 100 rules) can
be slow, and thus large rule-based systems can be unsuitable for real-time applications.

Inability to learn. In general, rule-based expert systems do not have an ability to learn from the
experience. Unlike a human expert, who knows when to ‘break the rules’, an expert system
cannot automatically modify its knowledge base, or adjust existing rules or add new ones. The
knowledge engineer is still responsible for revising and maintaining the system.

These systems don’t handle incomplete or incorrect information very well. data that does not
have an associated rule will be ignored. This means that rules-based systems are particularly bad
at detecting ‘unknown unknowns’ like new derivations of malware or new disease epidemics

Rules-based systems don’t know what to do with variables that have an infinite number of
possible values. There are many of these variables — for example a person’s weight, or the time
it takes to complete a task, or the price of a gallon of gas. Arbitrarily making these continuous
variables into discrete variables may mean missing patterns or deriving false patterns. For
example, a rule flagging someone who is more than 90 days’ delinquent on debt payments may
miss someone else who is chronically delinquent on debt in the last five years, but never more
than 89 days late for any one account. Who is riskier?

b) Identify the difference between forward and backward chaining. 4mks

These are strategies Used By The Inference Engine

The Inference Engine uses the following strategies to recommend solutions:

 Forward Chaining
 Backward Chaining

Forward Chaining

With this strategy, an expert system is able to answer the question “What can happen next?”

By following a chain of conditions and derivations, the expert system deduces the outcome after
considering all facts and rules. It then sorts them before arriving at a conclusion in terms of the
suitable solution.

This strategy is followed while working on conclusion, result, or effect. For example, predicting
how does the share market prediction of share market will react to the changes in the interest
rates.
Backward Chaining

Backward chaining is used by an expert system to answer the question “Why did this happen?”

Depending upon what has already occurred, the inference engine tries to identify the conditions
that could have happened in the past to trigger the final result. This strategy is used to find the
cause or the reason behind something happening. For example, the diagnosis of different types of
cancer in humans.

c) With examples distinguish between factual knowledge and heuristic knowledge.


4mks
Heuristic knowledge is representing knowledge of some experts in a field or subject.
Heuristic knowledge is rules of thumb based on previous experiences, awareness of approaches,
and which are good to work but not guaranteed.

d) What does domain refer to? 2mks


A domain is a particular field of thought, activity, or interest, especially one over which someone has
control, influence, or rights.

When referring to an Internet address or name, a domain or domain name is the location of a website.
For example, the domain name "google.com" points to the IP address "216.58.216.164". Generally, it's
easier to remember a name rather than a long string of numbers. A domain name contains a maximum
of sixty three characters, with one character minimum, and is entered after the protocol in the URL, as
shown in the following example.

Question 9
a) With relevant examples, explain at least five different applications of expert
systems. 10mks
b) Explain the benefits of expert systems. 10mks
Benefits of Expert Systems

 Availability − They are easily available due to mass production of software.


 Less Production Cost − Production cost is reasonable. This makes them affordable.
 Speed − They offer great speed. They reduce the amount of work an individual puts in.
 Less Error Rate − Error rate is low as compared to human errors.
 Reducing Risk − They can work in the environment dangerous to humans.
 Steady response − They work steadily without getting motional, tensed or fatigued

Question 10
a) Explain the term learning. 5mks

Learning is a process that improves the knowledge of an AI program by making observations about its
environment. Learning is the process of converting experience into expertise or knowledge.

b) Briefly explain the types of learning in Artificial intelligence. 15mks

Question 11.
a) With examples distinguish between an expert and expertise. 2mks
An expert is a person.
Expertise is an advanced level of knowledge on a certain subject.
An expert has expertise.

b) Discuss the approaches commonly used to develop interface Engines. 6mk


an inference engine is a component of the system that applies logical rules to the knowledge base to
deduce new information. The first inference engines were components of expert systems. The typical
expert system consisted of a knowledge base and an inference engine. The knowledge base stored facts
about the world. The inference engine applies logical rules to the knowledge base and deduced new
knowledge.

Approaches include Backward chaining and forward chaining

c) “Computers do think.” True or false? Explain your answer. 6mks

No, computers are actually very dumb. They simply cannot think. They can just take decisions
based on the logic fed to them by programmers.

A computer is never smart, the programmers are. They can make the computer think. If you
program them to say 2+2 equals 5, they will simply say 2+2 equals to 5, without thinking if the
result is correct or not.

Today, even a toddler can use a smartphone comfortably, and this is not because the
smartphone is smart. Its because the Engineers are becoming smarter. They can create
something that is very easy to use.
d) Explain the three functional components of an expert system. 6mks
 Knowledge base
 Interference Engine
 User interface
Question 12
a) Human reasoning capabilities are divided into three areas. Explain these areas 6mks
human intelligence, mental quality that consists of the abilities to learn from experience, adapt to new
situations, understand and handle abstract concepts, and use knowledge to manipulate one’s
environment.

Capability to reason

Capability to think

Capability to understand

b) Explain the three kinds of logical reasoning. 6mks


 Deductive,
 Inductive,
 Abductive Reasoning
c) Explain the three properties of formal systems. 6mks
Question 13
a) With illustration explain the term knowledge progression. 8mks
b) Explain the four types of knowledge representation. 8mks
c) Give the differences between Tacit and Explicit knowledge. 4mks
Question 14
a) What is a problem solving? 2mks
problem-solving refers to artificial intelligence techniques, including various techniques such as
forming efficient algorithms, heuristics, and performing root cause analysis to find desirable
solutions

Using AI techniques, we can solve these problems efficiently. In this sense, some of the most
common problems resolved by AI are

 Travelling Salesman Problem


 Tower of Hanoi Problem
 Water-Jug Problem
 N-Queen Problem
 Chess
b) Write short notes on the following terms. 2mks
(i) State
State — A potential outcome of a problem

A state is a representation of problem elements at a given moment.

(ii) State space

The state space of a dynamical system is the set of all possible states of the system. A State
space is the set of all states reachable from the initial state.

A state space forms a graph in which the nodes are states and the arcs between nodes are actions.

(iii) Initial state


In a typical planning problem, where the world is fully observable and deterministic, the initial
state is defined by specifying the value for each feature for the initial time. An achievement
goal is a proposition that must be true in the final state
(iv) Goal state
Goal State — The state to stop searching.

The desired resulting condition in a given problem, and what search algorithms are looking for. Some
problems may have a unique goal state (arrive at a given location, for example) whereas others can have
multiple goal states, all satisfying a set of conditions (checkmate in chess, for instance.)

c) What is search. 2mks


Search in AI is the process of navigating from a starting state to a goal state by transitioning
through intermediate states.
d) Differentiate between breadth and depth First Search. 4mks

Breadth First Search

BFS stands for Breadth First Search is a vertex based technique for finding a shortest path in
graph. It uses a Queue data structure which follows first in first out. In BFS, one vertex is
selected at a time when it is visited and marked then its adjacent are visited and stored in the
queue. It is slower than DFS. 
Ex- 
 

A
/\
B C
/ /\
D E F

Output is: 
 

A, B, C, D, E, F

Depth First Search

DFS stands for Depth First Search is a edge based technique. It uses the Stack data structure,
performs two stages, first visited vertices are pushed into stack and second if there is no vertices
then visited vertices are popped. 
Ex- 
 

A
/\
B C
/ /\
D E F

Output is: 

A, B, D, C, E, F

e) Performance of an algorithm depends on both the internal and external factors.


Explain these factors. 4mks
 Space complexity
 Use of computer time
 Programming effort
 Statistical deviation
 Time complexity
Question 16
a) Explain the Turing test to find out whether a machine is intelligent or not. 12mks
b) What would convince you that a given machine is truly intelligent. 8mks

An intelligent machine is any machine that can complete its given task in the presence of an
unreliable and dynamic working environment. An intelligent machine has the ability to monitor
its environment and then adjust its actions on the basis of what it senses. It also works as per the
prerequisites for intelligence. The term intelligent machine is given so that you can understand
the meaning of it easily. It simply means or consists of those criterion that would appear
intelligent if a person was doing it.
Artificial intelligence, that is the backbone of an intelligent machine, allows computers to take
in all of the world’s available information and combine various pieces of that information to
come up with new and better solutions. It does its work involving all aspects of human
intelligence.

Surprisingly, even Siri and Alexa are intelligent machines. Can you think of more such
examples?

It would think rationally like rational people, outperforming irrational people. Most people gain their
beliefs by acquiring them from people they trust rather than by thinking things through for themselves.
They are often able to reason fairly well if they’re asked to back up their correct beliefs, but when
they’re asked to do the same with their incorrect beliefs they lose that ability and start to break the
rules in order to protect their beliefs.

 The machine that thinks like a humans


 That act like humans
 System that thinks rationally
 Systems that act rationally

Question 17
a) State the advantages and disadvantages of an ES. 8mks
b) Explain the various stages of expert system. 4mks
Step 1: Identification:

Before we can begin to develop an expert system, it is important to describe, with as much
precision as possible, the problem which the system is intended to solve. It is not enough simply
to feel that an expert system would be helpful in a certain situation; we must determine the exact
nature of the problem and state the precise goals which indicate exactly how the expert system is
expected to contribute to the solution.

Stage # 2. Conceptualization:

Once we have formally identified the problem that an expert system is to solve, the next stage
involves analysing the problem further to ensure that its specifics, as well as it generalities, are
understood.

In the conceptualization stage, the knowledge engineer frequently creates a diagram of the
problem to depict graphically the relationships between the objects and processes in the problem
domain.
Stage # 3. Formalization (Designing):

In the preceding stages, no effort has been made to relate the domain problem to the artificial
intelligence technology which may solve it. During the identification and formalization stages,
the focus is entirely on understanding the problem. Now, during the formalization stage, the
problem is connected to its proposed solution, an expert system is supplied by analyzing the
relationships depicted in the conceptualization stage. The knowledge engineer begins to select
the techniques which are appropriate for developing this particular expert system.

Stage # 4. Implementation:

During the implementation stage the formalised concepts are programmed into the computer
which has been chosen for system development, using the predetermined techniques and tools to
implement a ‘first-pass’ (prototype) of the expert system.

Stage # 5. Testing (Validation, Verification and Maintenance):

The chance of prototype expert system executing flawlessly the first time it is tested are so slim
as to be virtually non-existent. A knowledge engineer does not expect the testing process to
verify that the system has been constructed entirely correctly. Rather, testing provides an
opportunity to identify the weaknesses in the structure and implementation of the system and to
make the appropriate corrections

c) Explain 6 benefits of expert systems. 12mks

d) Explain the three functional components of an expert system? 6mks


The Expert System in AI consists of the following given components:
 User Interface
 Inference Engine
 Knowledge Base
.

Question 18.
a) Explain the meaning of natural language processing. (NLP). What are the reasons
of studying a natural language? 10mks
NLP stands for Natural Language Processing, which is a part of Computer Science, Human
language, and Artificial Intelligence. It is the technology that is used by machines to
understand, analyse, manipulate, and interpret human's languages. It helps developers to organize
knowledge for performing tasks such as translation, automatic summarization, Named Entity
Recognition (NER), speech recognition, relationship extraction, and topic segmentation.

Natural language processing (NLP) refers to the branch of artificial intelligence or AI—
concerned with giving computers the ability to understand text and spoken words in much the
same way human beings can.

Top Reasons to Learn NLP

Here are some of the top reasons why professionals prefer to learn NLP.

NLP has various applications

Virtual assistants are just one of the popular applications of NLP. Sentiment analysis, text
classification, chatbots, customer experience, speech to text conversion and vice versa, are some
of the other areas where NLP has been leveraged. The common goal behind all these applications
is to take raw language input and use algorithms and linguistics to transform the text to gain
meaningful insights. Sectors like banking, insurance, healthcare, retail, media find NLP useful
for fraud detection, risk and compliance management, asset management, predictive
maintenance, and even client service. 

NLP is a major contributor to the growing AI market

The global artificial intelligence software market would witness massive growth, with revenues
expected to reach $118.6 billion by 2025 from around $9.5 billion in 2018. Applications like
NLP along with Robotic Process Automation (RPA) and Machine Learning largely form the
overall AI market. NLP is driving many forms of AI that humans are seeing today. Many
enterprises are now exploring their ways to use this technology to develop the most favourable
applications. 

Demand is high

No company today wants to ignore digital transformation. Every business is trying to leverage
the power of AI, be it for marketing campaigns, banking services, or to give users a personalized
experience. Text data forms a large portion of the unstructured data that companies are analyzing
to identify patterns and make data-driven decisions. As such, professionals skilled in NLP will be
in high demand for projects involving text analytics.

NLP is here to stay

Though not hyped as much as Big Data or Machine Learning, NLP is already helping humans
with their day-to-day tasks. Growing smartphone functionalities, usage of smart devices, and
automation of more routine human activities through Big Data would drive the adoption of NLP
in the future. When combined with IoT applications, NLP would facilitate humans to control
smart appliances through voice. Companies would use it to manage data more effectively,
provide enhanced customer experience, and more.

b) Give an account of the steps in the natural language understanding process. 10mks

Question 19.
a) Explain the term knowledge engineering. 3mks

Knowledge engineering is a field of artificial intelligence (AI) that creates rules to apply to data
to imitate the thought process of a human expert. It looks at the structure of a task or a decision
to identify how a conclusion is reached.

A library of problem-solving methods and the collateral knowledge used for each can then be
created and served up as problems to be diagnosed by the system. The resulting software could
then assist in diagnosis, trouble-shooting, and solving issues either on its own or in a support role
to a human agent.

Knowledge engineering is the technology behind the creation of expert systems to assist with
issues related to their programmed field of knowledge. Expert systems involve a large and
expandable knowledge base integrated with a rules engine that specifies how to apply
information in the knowledge base to each particular situation. The systems may also incorporate
machine learning so that they can learn from experience in the same way that humans do. Expert
systems are used in various fields including healthcare, customer service, financial services,
manufacturing and the law.

b) With examples explain two ways of building an expert system. 6mks


c) Explain the six aspects of intelligence studied by AI. 6mks
Intelligence has been defined in many ways: the capacity for abstraction, logic, understanding,
self-awareness, learning, emotional knowledge, reasoning, planning, creativity, critical thinking,
and problem-solving.
Intelligence; the ability to acquire and apply knowledge and skills.
Components/aspects of intelligence in AI:
learning, reasoning, problem solving, perception, and using language/language processing,
induction, deduction, problem solving, creativity, pattern recognition, classification, optimization
etc.
Learning/deep learning

There are a number of different forms of learning as applied to artificial intelligence. The
simplest is learning by trial and error. For example, a simple computer program for solving mate-
in-one chess problems might try moves at random until mate is found. The program might then
store the solution with the position so that the next time the computer encountered the same
position it would recall the solution. This simple memorizing of individual items and procedures
—known as rote learning—is relatively easy to implement on a computer.

Deep learning is a machine learning technique that teaches computers to do what comes naturally
to humans, to learn by example. Innumerable developers are leveraging the latest deep learning
innovative technologies to take their business to the new high.

Reasoning

To reason is to draw inferences appropriate to the situation. Inferences are classified as either
deductive or inductive. An example of the former is, “Fred must be in either the museum or the
café. He is not in the café; therefore, he is in the museum,” and of the latter, “Previous accidents
of this sort were caused by instrument failure; therefore, this accident was caused by instrument
failure.” The most significant difference between these forms of reasoning is that in the
deductive case the truth of the premises guarantees the truth of the conclusion, whereas in the
inductive case the truth of the premise lends support to the conclusion without giving absolute
assurance

Problem solving

Problem solving, particularly in artificial intelligence, may be characterized as a systematic


search through a range of possible actions in order to reach some predefined goal or solution.
Problem-solving methods divide into special purpose and general purpose. A special-purpose
method is tailor-made for a particular problem and often exploits very specific features of the
situation in which the problem is embedded. In contrast, a general-purpose method is applicable
to a wide variety of problems.

Perception

In perception the environment is scanned by means of various sensory organs, real or artificial,
and the scene is decomposed into separate objects in various spatial relationships. Analysis is
complicated by the fact that an object may appear different depending on the angle from which it
is viewed, the direction and intensity of illumination in the scene, and how much the object
contrasts with the surrounding field.

Language processing

A language is a system of signs having meaning by convention. In this sense, language need not
be confined to the spoken word. Traffic signs, for example, form a minilanguage, it being a
matter of convention that ⚠ means “hazard ahead” in some countries. It is distinctive of
languages that linguistic units possess meaning by convention, and linguistic meaning is very
different from what is called natural meaning, exemplified in statements such as “Those clouds
mean rain” and “The fall in pressure means the valve is malfunctioning.”

Facial Recognition/pattern recognition

Artificial Intelligence has made it possible to recognize individual faces using biometric
mapping. This has lead to pathbreaking advancements in surveillance technologies. It compares
the knowledge with a database of known faces to seek out a match.

However, this has also faced a lot of criticism for breach of privacy.

For example, Clearview AI, an American technology company, offers surveillance technology
for law agencies to monitor entire cities with a network of CCTV Cameras exactly assigning
each and every citizen with their Social Credit Score in real-time.

Data Ingestion

With every passing day, the data that we are all producing is growing exponentially, which is
where AI steps in. Instead of manually feeding this data, AI-enabled not just gathers this data
but also analyses it with the help of its previous experiences.

Data ingestion is that the transportation of knowledge from assorted sources to a data-storage
medium where it are often accessed, used, and analyzed by a corporation.

d) List most used AI programing languages. 5mks

Table of Contents

 Python

Python (official website) is among developer’s favorites programming languages in AI


development because of its syntax simplicity and versatility. Python is very encouraging for
machine learning for developers as it is less complex as compared to C++ and Java. It also a very
portable language as it is used on platforms including Linux, Windows, Mac OS, and UNIX. It is
also likable from its features such as Interactive, interpreted, modular, dynamic, portable and
high level which make it more unique than Java.

 C++

C++ is the fastest computer language; its speed is appreciated for AI programming projects that
are time sensitive. It provides faster execution and has less response time which is applied in
search engines and development of computer games. In addition, C++ allows extensive use of
algorithms and is efficient in using statistical AI techniques. Another important factor is that C++
supports re-use of programs in development due to inheritance and data-hiding thus efficient in
time and cost saving.

 Java

Java (official website) is another programming language to answer ‘which computer language is
used for artificial intelligence?’ Java is also a multi-paradigm language that follows object-
oriented principles and the principle of Once Written Read/Run Anywhere (WORA). It is an AI
programming language that can run on any platform that supports it without the need for
recompilation.

Java is one of the most commonly used and not just in AI development. It derives a major part of
its syntax from C and C++ in addition to its lesser tools that them. Java is not only appropriate
for NLP and search algorithms but also for neural networks.

 LISP

LISP is another language used for artificial intelligence development. It is a family of computer
programming language and is the second oldest programming language after Fortran. LISP has
developed over time to become strong and dynamic language in coding.

Some consider LISP as the best AI programming language due to the favour of liberty it offers
developers. LISP is used in AI because of its flexibility for fast in prototyping and
experimentation which in turn facilitate LISP to grow to a standard AI language. For instance,
LISP has a unique macro system which facilitates exploration and implementation of different
levels of Intellectual Intelligence.

 Prolog

Prolog is also one of the oldest programming languages thus also suitable for the development of
programming AI. Like Lisp, it is also a primary computer language for artificial intelligence. It
has mechanisms that facilitate flexible frameworks developers enjoy working with. It is a rule-
based and declarative language as it contains facts and rules that dictate its artificial intelligence
coding language.
Prolog supports basic mechanisms such as pattern matching, tree-based data structuring, and
automatic backtracking essential for AI programming. Other than its extensive use in AI
projects, Prolog is also used for creation of medical systems.

Question 20
a) What is logic. 2mks
Logic is a tool to develop reasonable conclusions based on a given set of data. It is free of
emotion and deals very specifically with information in its purest form.

Logic is a language for reasoning; a collection of rules used while doing logical reasoning.

For example,

1.If a person walked into a room and saw children holding markers and then saw marker
scribbles all over the walls, logic would dictate that from the given the information presented, the
children drew all over the walls with markers. There is no direct evidence or confession, but
logical principles reveal what is true based on the given information.

2.If you came home and found your leftovers were gone from the fridge and you lived with a
roommate, logic would dictate your roommate ate your food based on the fact no one else should
be in the house.

b) Explain at least five types of logic. 10mks


Main ones in notes are;
 Propositional logic; logic of sentences
Propositions are sentences either true or false but not both
A sentence is smallest unit in propositional logic
If proposition is true, then truth value is true, else false
Example;
Sentence: grass is green. Truth value “true”. Proposition is “yes”.
 Predicate logic; logic of objects
Predicate is a function may be true or false for arguments
Predicate logic are rules that govern quantifiers
Predicate logic is propositional logic added with quantifiers
Examples;
“The car Tom is driving is blue”,
“The sky is blue”,
“The cover of this book is blue”
Predicate; is blue, give a name B;
Sentence represented as B(x); read B(x) as “x is blue”;
Object; represented as x.

 Logic involving uncertainties


 Fuzzy logic; dealing with fuzziness
 Temporal logic, etc.

There are many types of logic located within the governing science. The main logic types are:

 Informal logic

Informal logic is the mode used in everyday reasoning and argument analysis.

Most people use informal logic every day, as it's how we reason and form argumentation in the
moment.

For example, arguing with a friend about if Rachel and Ross were on a break in the TV show
Friends would result in the use of informal logic. On the show, the couple decided to take time
away from each other, and in that time, Ross slept with another woman. Ross argues they were
on a break, and Rachel argues they weren't. For this argument, each person uses the information
presented and creates their conclusion based on their understanding of the word '~break'~.

Informal logic consists of two types of reasoning to make arguments:

Deductive reasoning: Uses information from various sources and applies that information to the
argument at hand to support a larger, generalized conclusion (applies information to any member
of that set.
Example; All English professors are boring. Brian is an English professor. Conclusion; Brian is
boring.

Inductive reasoning: Uses the specific information given to form a generalized conclusion.
Example; Yesterday you left home at 7:00am and arrived on time. Today you left home at 7:00
and arrived on time. Conclusion; when you leave home at 7:00 am you will always arrive on
time.

 Formal logic

Formal logic uses deductive reasoning in conjunction with syllogisms and mathematical symbols
to infer if a conclusion is valid or invalid. In formal logic, a person looks to ensure the premises
made about a topic logically connects to the conclusion.

A common example of a formal logic is the use of a syllogism to explain those connections. A
syllogism is a form of reasoning which draws conclusions based on two given premises. In each
syllogism, there are two premises and one conclusion is about Socrates.

Premise A; Socrates is a man

Premise B; All men are mortal

Conclusion: Socrates are mortal

 Symbolic logic
 Mathematical logic
 Monotonic logic

The property of being monotonic. In logic, it refers to the fact that a valid argument cannot
be made invalid, nor an invalid argument made valid, by adding new premises. More
precisely, monotonicity in logic is the property of obeying the extension theorem of semantic
entailment.

Example;

Sun rises in the East and sets in the West.

Earth revolves around the Sun.


 Non-monotonic logic

Logic will be said as non-monotonic if some conclusions can be invalidated by adding more
knowledge into our knowledge base.

Non-monotonic deals with incomplete and uncertain models.

Example: Let suppose the knowledge base contains the following knowledge:

Birds can fly

Penguins cannot fly

Pitty is a bird

So, from the above sentences, we can conclude that Pitty can fly.

However, if we add one another sentence into knowledge base "Pitty is a penguin", which
concludes "Pitty cannot fly", so it invalidates the above conclusion.

c) Explain the four fundamental search techniques in AI. 8mks


Search is a problem-solving technique that systematically consider all possible action to find a
path from initial state to target state.
Search techniques are many; the most fundamental are
 Depth first
 Breadth first
 Hill climbing
 Least cost
The four search AI techniques include;
 Depth-first search
Assume any path is a good as any other path.
At each node, pick an arbitrary path and work forward until a solution is found or a dead end is
reached.
In case of a dead end- back track to the last node in the tree where a previously unexplored path
branches of, and test this path.
 Breadth-first search
Look for a solution amongst all nodes at a given level before proceeding to the next.
 Hill climbing.
Like depth first search, but involving some quantitative decision on ‘most likely’ path to follow
at each node.
 Least cost;
The simplest search method that is guaranteed to find a minimum cost path is lowest-cost-first search,
which is similar to breadth-first search, but instead of expanding a path with the fewest number of arcs,
it selects a path with the lowest cost.

You might also like