# embedding_metadata

key: chroma:document
string_value:
Artificial Intelligence  
  i 
About the T utorial 
This tutorial provides introductory knowledge on Artificial Intelligence. It would come to a 
great help if you are about to select Artificial Intelligence as a course subject. You can briefly 
know about the areas of AI in which research is prospering.  
 
 
Audience 
This tutorial is prepared for the students at beginner level who aspire to learn Artificial 
Intelligence.  
 
 
Prerequisites


key: chroma:document
string_value:
Intelligence.  
 
 
Prerequisites 
The basic knowledge of Computer Science is mandatory. The knowledge of Mathematics, 
Languages, Science, Mechanical or Electrical engineering is a plus.  
 
Disclaimer & Copyright 
 Copyright 2015 by Tutorials Point (I) Pvt. Ltd.  
All the content and graphics published in this e -book are the property of Tutorials Point (I) 
Pvt. Ltd. The user of this e -book is prohibited to reuse, retain, copy, distribute or republish


key: chroma:document
string_value:
any contents or a part of contents of this e -book in any manner without wri tten consent of 
the publisher.  
We strive to update the contents of our website and tutorials as timely and as precisely as  
possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt. 
Ltd. provides no guarantee regarding the accuracy, timeliness or completeness of our website 
or its contents including this tutorial. If you discover any errors o n our website or in this


key: chroma:document
string_value:
tutorial, please notify us at contact@tutorialspoint.com.  Artificial Intelligence  
  ii 
T able of Contents  
About the Tutorial ......................................................................................................................................... i 
Audience ....................................................................................................................................................... i


key: chroma:document
string_value:
Prerequisites ................................................................................................................................................. i 
Disclaimer & Copyright .................................................................................................................................. i 
Table of Contents ......................................................................................................................................... ii


key: chroma:document
string_value:
1. OVERVIEW OF AI ................................ ................................ ................................ ...................... 1 
What is Artificial Intelligence? ...................................................................................................................... 1 
Philosophy of AI ........................................................................................................................................... 1


key: chroma:document
string_value:
Goals of AI .................................................................................................................................................... 1 
What Contributes to AI? ............................................................................................................................... 2 
Programming Without and With AI .............................................................................................................. 2


key: chroma:document
string_value:
What is AI Technique? .................................................................................................................................. 3 
Applications of AI ......................................................................................................................................... 3 
History of AI ................................................................................................................................................. 4


key: chroma:document
string_value:
2. INTELLIGENT SYSTEMS ................................ ................................ ................................ ............. 6 
What is Intelligence? .................................................................................................................................... 6 
Types of Intelligence..................................................................................................................................... 6


key: chroma:document
string_value:
What is Intelligence Composed of? .............................................................................................................. 7 
Difference between Human and Machine Intelligence ................................................................................. 9 
3. RESEARCH AREAS OF AI ................................ ................................ ................................ .......... 10


key: chroma:document
string_value:
Real Life Applications of Research Areas .................................................................................................... 11 
Task Classification of AI .............................................................................................................................. 12  Artificial Intelligence  
  iii 
4. AGENTS AND ENVIRONMENTS ................................ ................................ ...............................  14


key: chroma:document
string_value:
What are Agent and Environment? ............................................................................................................ 14 
Agents Terminology ................................................................................................................................... 14 
Rationality .................................................................................................................................................. 15


key: chroma:document
string_value:
What is Ideal Rational Agent? .................................................................................................................... 15 
The Structure of Intelligent Agents ............................................................................................................. 15 
The Nature of Environments ...................................................................................................................... 18


key: chroma:document
string_value:
Properties of Environment ......................................................................................................................... 19 
5. POPULAR SEARCH ALGORITHMS ................................ ................................ ............................  20 
Single Agent Pathfinding Problems............................................................................................................. 20


key: chroma:document
string_value:
Search Terminology .................................................................................................................................... 20 
Brute-Force Search Strategies .................................................................................................................... 20 
Informed (Heuristic) Search Strategies ....................................................................................................... 23


key: chroma:document
string_value:
Local Search Algorithms ............................................................................................................................. 24 
6. FUZZY LOGIC SYSTEMS ................................ ................................ ................................ ........... 27 
What is Fuzzy Logic? ................................................................................................................................... 27


key: chroma:document
string_value:
Why Fuzzy Logic? ........................................................................................................................................ 27 
Fuzzy Logic Systems Architecture ............................................................................................................... 28 
Example of a Fuzzy Logic System ................................................................................................................ 29


key: chroma:document
string_value:
Application Areas of Fuzzy Logic ................................................................................................................. 32 
Advantages of FLSs ..................................................................................................................................... 33 
Disadvantages of FLSs ................................................................................................................................ 33 
  Artificial Intelligence  
  iv


key: chroma:document
string_value:
Artificial Intelligence  
  iv 
7. NATURAL LANGUAGE PROCESSING ................................ ................................ ........................  34 
Components of NLP .................................................................................................................................... 34 
Difficulties in NLU ....................................................................................................................................... 34


key: chroma:document
string_value:
NLP Terminology ........................................................................................................................................ 35 
Steps in NLP................................................................................................................................................ 35 
Implementation Aspects of Syntactic Analysis............................................................................................ 36


key: chroma:document
string_value:
8. EXPERT SYSTEMS................................ ................................ ................................ .................... 40 
What are Expert Systems? .......................................................................................................................... 40 
Capabilities of Expert Systems .................................................................................................................... 40


key: chroma:document
string_value:
Components of Expert Systems .................................................................................................................. 41 
Knowledge Base ......................................................................................................................................... 41 
Inference Engine ......................................................................................................................................... 42


key: chroma:document
string_value:
User Interface ............................................................................................................................................. 43 
Expert Systems Limitations......................................................................................................................... 44 
Applications of Expert System .................................................................................................................... 44


key: chroma:document
string_value:
Expert System Technology .......................................................................................................................... 45 
Development of Expert Systems: General Steps ......................................................................................... 45 
Benefits of Expert Systems ......................................................................................................................... 46


key: chroma:document
string_value:
9. ROBOTICS ................................ ................................ ................................ ..............................  47 
What are Robots? ....................................................................................................................................... 47 
What is Robotics? ....................................................................................................................................... 47


key: chroma:document
string_value:
Difference in Robot System and Other AI Program ..................................................................................... 47 
Robot Locomotion ...................................................................................................................................... 48 
Components of a Robot .............................................................................................................................. 50  Artificial Intelligence  
  v


key: chroma:document
string_value:
v 
Computer Vision ......................................................................................................................................... 50 
Tasks of Computer Vision ........................................................................................................................... 50 
Application Domains of Computer Vision ................................................................................................... 51


key: chroma:document
string_value:
Applications of Robotics ............................................................................................................................. 51 
10. NEURAL NETWORKS ................................ ................................ ................................ ............... 53 
What are Artificial Neural Networks (ANNs)? ............................................................................................. 53


key: chroma:document
string_value:
Basic Structure of ANNs .............................................................................................................................. 53 
Types of Artificial Neural Networks ............................................................................................................ 54 
Working of ANNs ........................................................................................................................................ 55


key: chroma:document
string_value:
Machine Learning in ANNs ......................................................................................................................... 55 
Bayesian Networks (BN) ............................................................................................................................. 56 
Applications of Neural Networks ................................................................................................................ 59


key: chroma:document
string_value:
11. AI ISSUES ................................ ................................ ................................ ................................  61 
12. AI TERMINOLOGY ................................ ................................ ................................ ................... 62 
  Artificial Intelligence  
  1 
Since the invention of computers or machines, their capability to perform various tasks went


key: chroma:document
string_value:
on growing exponentially. Humans have developed the power of computer systems in terms 
of their diverse working domains, their increasing speed, and reducing size with respect to 
time.  
A branch of Computer Science named Artificial Intelligence pursues creating the computers or 
machines as intelligent as human beings. 
What is Artificial Intelligence? 
According to  the father of A rtificial Intelligence John McCarthy , it is “The science and


key: chroma:document
string_value:
engineering of making intelligent machines, especially intelligent computer programs”. 
Artificial Intelligence is a way of making a computer, a computer-controlled robot, or a 
software think intelligently, in the similar manner the intelligent humans think.  
AI is accomplished by studying how human brain thinks, and how humans learn, decide, and 
work while trying to solve a problem, and then using the outcomes of this study as a basis of 
developing intelligent software and systems.


key: chroma:document
string_value:
developing intelligent software and systems. 
Philosophy of AI 
While exploiting the power of the computer systems, the  curiosity of human, lead him to 
wonder, “Can a machine think and behave like humans do?”  
Thus, the development of AI started with the intention of creating similar intelligence in 
machines that we find and regard high in humans.    
Goals of AI 
 To Create Expert Systems: The systems whi ch exhibit intelligent behavior, learn,


key: chroma:document
string_value:
demonstrate, explain, and advice its users. 
 To Implement Human Intelligence  in Machines : Creating systems that 
understand, think, learn, and behave like humans. 
 
 
1. Overview of AI   Artificial Intelligence  
  2 
What Contributes to AI? 
Artificial intelligence is a science and technology based on disciplines such as Computer 
Science, Biology, Psychology, Linguistics, Mathematics, and Engineering. A major thrust of AI


key: chroma:document
string_value:
is in the development of computer function s associated with human intelligence, such as 
reasoning, learning, and problem solving. 
Out of the following areas, one or multiple areas can contribute to build an intelligent system. 
 
Programming Without and With AI  
The programming without and with AI is different in following ways: 
Programming Without AI Programming With AI 
A computer program without AI can 
answer the specific questions it is meant 
to solve.


key: chroma:document
string_value:
to solve. 
A computer program with  AI can answer the 
generic questions it is meant to solve. 
Modification in the program leads to 
change in its structure. 
AI programs can absorb new modifications by 
putting highly independent pieces of 
information together. Hence you can modify 
even a minute piece of information of program 
without affecting its structure. 
Modification is not quick  and easy. It may 
lead to affecting the program adversely. Quick and Easy program modification.


key: chroma:document
string_value:
Artificial Intelligence  
  3 
What is AI T echnique? 
In the real world, the knowledge has some unwelcomed properties: 
 Its volume is huge, next to unimaginable. 
 It is not well-organized or well-formatted. 
 It keeps changing constantly. 
AI Technique is a manner to organize and use the knowledge efficiently in such a way that: 
 It should be perceivable by the people who provide it. 
 It should be easily modifiable to correct errors.


key: chroma:document
string_value:
 It should be useful in many situations though it is incomplete or inaccurate. 
AI techniques elevate the speed of execution of the complex program it is equipped with.  
Applications of AI 
AI has been dominant in various fields such as: 
 Gaming 
AI plays crucial role in strategic games such as chess, poker, tic -tac-toe, etc., where 
machine can think of large number of possible positions based on heuristic knowledge.   
 Natural Language Processing


key: chroma:document
string_value:
 Natural Language Processing 
It is possible to interact with the computer that understa nds natural language spoken 
by humans.  
 Expert Systems 
There are some applications which integrate machine, software , and special 
information to impart reasoning and advising. They provide explanation and advice to 
the users.  
 Vision Systems 
These systems understand, interpret, and comprehend visual input on the computer . 
For example,


key: chroma:document
string_value:
For example,  
o A s pying aeroplane takes photographs which are used to figure out spatial 
information or map of the areas. 
o Doctors use clinical expert system to diagnose the patient. 
o Police use computer software that can recognize the face of criminal with the 
stored portrait made by forensic artist. 
 
  Artificial Intelligence  
  4 
 Speech Recognition 
Some intelligent systems are capable of hearing and comprehending the language in


key: chroma:document
string_value:
terms of sentences and their meanings while a human talks to it. It can handle different 
accents, slang words, noise in the background, change in human’s noise due to cold, 
etc.  
 
 Handwriting Recognition 
The handwriting recognition software reads the text written on paper by a pen or on 
screen by a stylus. It can recognize the shapes of the letters and convert it into editable 
text. 
 
 Intelligent Robots


key: chroma:document
string_value:
text. 
 
 Intelligent Robots 
Robots are able to perform t he tasks given by a human. They have sensors to detect 
physical data from the real world such as light, heat, temperature, movement, sound, 
bump, and pressure . They have efficient processors, multiple sensors and huge 
memory, to exhibit i ntelligence. In addition, they are capable of learning from their 
mistakes and they can adapt to the new environment. 
History of AI 
Here is the history of AI during 20th century:


key: chroma:document
string_value:
Here is the history of AI during 20th century:  
Year Milestone / Innovation 
1923 Karel Čapek’s play named “Rossum's Universal Robots” (RUR) opens in London, 
first use of the word "robot" in English. 
1943 Foundations for neural networks laid. 
1945 Isaac Asimov, a Columbia University alumni, coined the term Robotics. 
1950 
Alan Turing introduced Turing Test for evaluation of intelligence and published 
Computing Machinery and Intelligence.  Claude Shannon published Detailed


key: chroma:document
string_value:
Analysis of Chess Playing as a search. 
1956 John McCarthy coined the term Artificial Intelligence. Demonstration of the first 
running AI program at Carnegie Mellon University. 
1958 John McCarthy invents LISP programming language for AI. 
1964 Danny Bobrow's dissertation at MIT showed that computers can understand 
natural language well enough to solve algebra word problems correctly. 
1965 Joseph Weizenbaum at MIT built ELIZA, an interactive problem that carries on 
a dialogue in English.


key: chroma:document
string_value:
a dialogue in English. 
1969 Scientists at Stanford Research Institute Developed Shakey, a robot, equipped 
with locomotion, perception, and problem solving.  Artificial Intelligence  
  5 
1973 The Assembly Robotics group at Edinburgh University built Freddy, the Famous 
Scottish Robot, capable of using vision to locate and assemble models. 
1979 The first computer-controlled autonomous vehicle, Stanford Cart, was built. 
1985


key: chroma:document
string_value:
1985 
 Harold Cohen created and demonstrated the drawing program, Aaron. 
1990 
Major advances in all areas of AI:  
 Significant demonstrations in machine learning  
 Case-based reasoning  
 Multi-agent planning  
 Scheduling  
 Data mining, Web Crawler 
 natural language understanding and translation 
 Vision, Virtual Reality  
 Games 
1997 The Deep Blue Chess Program beats the then world chess champion, Garry 
Kasparov. 
2000


key: chroma:document
string_value:
Kasparov. 
2000 
Interactive robot pets become commercially available. MIT displays Kismet, a 
robot with a face that expresses emotion s. The robot Nomad explores remote 
regions of Antarctica and locates meteorites. 
  Artificial Intelligence  
  6 
While studying artificially intelligence, you need to know what intelligence  is. This chapter 
covers Idea of intelligence, types, and components of intelligence.  
What is Intelligence?


key: chroma:document
string_value:
What is Intelligence? 
The ability of a system to calculate, reason, perceive relationships and analogies, learn from 
experience, store and retrieve information from memory, solve problems, comprehend 
complex ideas, use natural language fluently, classify, generalize, and adapt new situations. 
T ypes of Intelligence 
As described by Howard Gardner, an American developmental psychologist, the Intelligence 
comes in multifold: 
Intelligence Description Example 
Linguistic 
intelligence


key: chroma:document
string_value:
Linguistic 
intelligence 
The ability to speak, recognize, and use mechanisms 
of phonology (speech sounds), syntax (grammar), 
and semantics (meaning). 
Narrators, Orators 
Musical intelligence 
The ability to create, communicate  with, and 
understand meanings made of sound, understanding 
of pitch, rhythm. 
Musicians, 
Singers, 
Composers 
Logical-
mathematical 
intelligence 
The ability of use and understand relationships in the 
absence of action or objects. Understanding complex


key: chroma:document
string_value:
and abstract ideas. 
Mathematicians, 
Scientists 
Spatial intelligence 
The ability to perceive visual or spatial information, 
change it, and re -create visual images without 
reference to the objects,  construct 3D images, and 
to move and rotate them. 
Map readers , 
Astronauts, 
Physicists 
Bodily-Kinesthetic 
intelligence 
The ability to use complete or part of the  body to 
solve problems or fashion products, control over fine 
and coarse motor skills, and manipulate the objects.


key: chroma:document
string_value:
Players, Dancers 
Intra-personal 
intelligence 
The ability to distinguish among one’s own feelings, 
intentions, and motivations. Gautam Buddha 
2. IntelligenT Systems  Artificial Intelligence  
  7 
Interpersonal 
intelligence 
The ability to recognize and make distinctions among 
other people’s feelings, beliefs, and intentions. 
Mass 
Communicators, 
Interviewers 
 
You can say a machine or a system is artificially intelligent when it is equipped with at least


key: chroma:document
string_value:
one and at most all intelligences in it.  
What is Intelligence Composed of? 
The intelligence is intangible. It is composed of: 
1. Reasoning 
2. Learning 
3. Problem Solving 
4. Perception 
5. Linguistic Intelligence 
 
 
Let us go through all the components briefly: 
1. Reasoning: It is the set of processes that enables us to provide basis for judgement, 
making decisions, and prediction. There are broadly two types: 
Inductive Reasoning Deductive Reasoning


key: chroma:document
string_value:
Inductive Reasoning Deductive Reasoning 
It conducts specific observations to makes 
broad general statements. 
It starts with a general statement and 
examines the possibilities to reach a specific, 
logical conclusion. 
Even if all of the premises are true in a 
statement, inductive reasoning allows for the 
conclusion to be false. 
If something is true of a class of things in 
general, it is also true for all members of that 
class. 
 Artificial Intelligence  
  8 
Example:


key: chroma:document
string_value:
class. 
 Artificial Intelligence  
  8 
Example: 
“Nita is a teacher.  
All teachers are studious.  
Therefore, Nita is studious.” 
Example:  
"All women of age above 60 years  are 
grandmothers.  
Shalini is 65 years.  
Therefore, Shalini is a grandmother."  
 
2. Learning: It is the activity of gaining knowledge or skill by studying, practising, being 
taught, or experiencing something . Learning enhances the awareness of the subjects 
of the study.


key: chroma:document
string_value:
of the study.  
    The ability of lea rning is possessed by humans, some animals, and AI -enabled   
systems. Learning is categorized as: 
o Auditory Learning: It is learning by listening and hearing. For example, students 
listening to recorded audio lectures. 
 
o Episodic Learning: To learn by remembering sequences of events that one has 
witnessed or experienced. This is linear and orderly. 
 
o Motor Learning: It is learning by precise movement of muscles. For example,


key: chroma:document
string_value:
picking objects, Writing, etc. 
 
o Observational Learning: To learn by watching and imitating others. For example, 
child tries to learn by mimicking her parent.   
 
o Perceptual Learning: It is learning to recognize stimuli that one has seen before. 
For example, identifying and classifying objects and situations. 
 
o Relational Learning: It involves learning to differentiate among various stimuli 
on the basis of relational properties, rather than absolute properties. For Example,


key: chroma:document
string_value:
Adding ‘little less’ salt at the time of cooking potatoes that came up salty last time, 
when cooked with adding say a tablespoon of salt.  
 
o Spatial learning : It is learning through visual stimuli such as images, colors, 
maps, etc. For Example,  A person can create roadmap in mind before actually 
following the road.  
 
o Stimulus-Response Learning: It is l earning to perform a part icular behavior 
when a certain stimulus is present . For example, a dog raises its ear on hearing


key: chroma:document
string_value:
doorbell.  
3. Problem solving: It is the process in which one perceives and tries to arrive at a 
desired solution from a present situation by taking some path, wh ich is blocked by 
known or unknown hurdles. 
Problem solving also includes decision making, which is the process of selecting the 
best suitable alternative out of multiple alternatives to reach the desired goal are 
available.  
4. Perception: It is the process of acquiring, interpreting, selecting, and organizing


key: chroma:document
string_value:
sensory information.  Artificial Intelligence  
  9 
Perception presumes sensing. In humans, perception is aided by sensory organs. In 
the domain of AI, perception mechanism puts the data acquired by the sensors 
together in a meaningful manner.  
5. Linguistic Intelligence: It is one’s ability to use, comprehend, speak, and write the 
verbal and written language. It is important in interpersonal communication. 
Difference between Human and Machine Intelligence


key: chroma:document
string_value:
 Humans perceive by patterns whereas the machines perceive by set of rules and data. 
 Humans store and recall information by patterns, machines do it by searching 
algorithms. For example, the number 40404040 is easy to remember, store and recall 
as its pattern is simple. 
 
 Humans can figur e out the complete object even if some part of it is missing or 
distorted; whereas the machines cannot correctly.  Artificial Intelligence  
  10


key: chroma:document
string_value:
10 
The domain of artificial intelligence is huge in breadth and width. W hile proceeding, w e 
consider the broadly common and prospering research areas in the domain of AI: 
 
Speech and Voice Recognition 
These both terms are common in robotics, expert systems and natural language processing. 
Though these terms are used interchangeably, their objectives are different. 
Speech Recognition Voice Recognition 
The s peech recognition aims at 
understanding and comprehend ing WHAT


key: chroma:document
string_value:
understanding and comprehend ing WHAT 
was spoken. 
The objective of voice recognition is to 
recognize WHO is speaking. 
It is used in hand -free computing, map or 
menu navigation 
It analyzes person’s t one, voice pitch, and 
accent, etc., to identify a person. 
Machine does not need training as it is not 
speaker dependent. 
The recognition system needs training as it 
is person-oriented. 
3. Research Areas of AI  Artificial Intelligence  
  11 
Speaker independent Speech Recognition


key: chroma:document
string_value:
11 
Speaker independent Speech Recognition 
systems are difficult to develop. 
Speaker-dependent Speech Recognition 
systems are comparatively easy to develop. 
Working of Speech and Voice Recognition Systems  
The user input spoken at a microphone goes to sound card of the system. The converter turns 
the analog signal into equivalent digital signal for the speech processing. The database is used 
to compare the patterns to recognize the words. Finally , a reverse feedback is given to the


key: chroma:document
string_value:
database. 
This source-language text becomes input to the Translation Engine, which converts it to  the 
target language text. They are supported with interactive GUI, large database of vocabulary 
etc. 
Real Life Applications of Research Areas 
There is a large array of applications where AI is serving common people in their day -to-day 
lives: 
Sr. No. Research Area Real Life Application  
1 
Expert Systems 
 
Examples: Flight-tracking systems, Clinical 
systems 
 
2


key: chroma:document
string_value:
systems 
 
2 
Natural Language Processing 
 
Examples: Google Now feature , speech 
recognition, Automatic voice output 
 
3 
Neural Networks 
 
Examples: Pattern recogn ition system s such as  
face recognition, character recognition, handwriting 
recognition. 
 
 Artificial Intelligence  
  12 
4 
Robotics 
 
Examples: Industrial robots for moving, spraying, 
painting, precision checking, drilling, cleaning, 
coating, carving etc. 
 
5 
Fuzzy Logic


key: chroma:document
string_value:
coating, carving etc. 
 
5 
Fuzzy Logic 
 
Examples: Consumer electronics, automobiles , 
etc. 
 
T ask Classification of AI 
The domain of AI is classified into Formal tasks, Mundane tasks, and Expert tasks.  
 
 Artificial Intelligence  
  13 
Task Domains of Artificial Intelligence 
Mundane (Ordinary) Tasks Formal Tasks Expert Tasks 
Perception 
 Computer Vision 
 Speech, Voice 
 Mathematics 
 Geometry 
 Logic 
 Integration and 
Differentiation 
 Engineering 
 Fault finding


key: chroma:document
string_value:
Differentiation 
 Engineering 
 Fault finding 
 Manufacturing 
 Monitoring 
Natural Language Processing 
 Understanding 
 Language Generation 
 Language Translation 
Games 
 Go 
 Chess (Deep Blue) 
 Checkers 
Scientific Analysis 
 
Common Sense Verification Financial Analysis 
Reasoning Theorem Proving Medical Diagnosis 
Planning  Creativity 
Robotics 
 Locomotive 
  
 
Humans learn mundane (ordinary) tasks  since their birth. They learn by perce ption,


key: chroma:document
string_value:
speaking, using language, and locomotives. They learn Formal Tasks and Expert Tasks later, 
in that order.  
For humans, the mundane tasks are easiest to learn. The same was considered true before 
trying to implement mundane tasks in machines. Earlier , all work of AI was concentrated in 
the mundane task domain.  
Later, it turned out that the machine requires more knowledge, complex knowledge 
representation, and complicated algorithms for handling mundane tasks. This is the reason


key: chroma:document
string_value:
why AI work is more pr ospering in the  Expert Task domain now, as the expert task 
domain needs expert knowledge without common sense, which can be easier to represent and 
handle.   
 
 
  Artificial Intelligence  
  14 
An AI system is composed of an agent and its environment. The agents ac t in their 
environment. The environment may contain other agents. 
What are Agent and Environment? 
An agent is anything that can perceive its environment through sensors and acts upon that


key: chroma:document
string_value:
environment through effectors.  
 A human agent has sensory organs such as eyes, ears, nose, tongue and skin parallel 
to the sensors, and other organs such as hands, legs, mouth, for effectors.  
 A robotic agent  replaces cameras and infrared range finders for the sensors , and 
various motors and actuators for effectors.  
 A software agent has encoded bit strings as its programs and actions. 
 
Agents T erminology


key: chroma:document
string_value:
Agents T erminology 
 Performance Measure of Agent: It is the criteria, which determines how successful 
an agent is. 
 Behavior of Agent: It is the action that agent performs after any given seq uence of 
percepts. 
 Percept: It is agent’s perceptual inputs at a given instance.  
 Percept Sequence: It is the history of all that an agent has perceived till date.  
4. Agents and Environments  Artificial Intelligence  
  15


key: chroma:document
string_value:
15 
 Agent Function: It is a map from the precept sequence to an action. 
Rationality 
Rationality is nothing but status of being reasonable, sensible, and having good sense of 
judgment. 
Rationality is concerned with expected actions and results depending upon what the agent has 
perceived. Performing actions with the aim of  obtaining useful information is an important 
part of rationality. 
What is Ideal Rational Agent?


key: chroma:document
string_value:
What is Ideal Rational Agent? 
An ideal rational agent is the one, which is capable of doing expected actions to maximize its 
performance measure, on the basis of: 
 Its percept sequence  
 Its built-in knowledge base 
Rationality of an agent depends on the following:  
1. The performance measures, which determine the degree of success.  
2. Agent’s Percept Sequence till now.  
3. The agent’s prior knowledge about the environment.  
4. The actions that the agent can carry out.


key: chroma:document
string_value:
4. The actions that the agent can carry out.  
A rational agent always performs right action, where the right action means the action that 
causes the agent to be most successful in the given percept sequence. The problem the agent 
solves is characterized by Performance Measure, Environment, Actuators, and Sensors 
(PEAS). 
The Structure of Intelligent Agents 
Agent’s structure can be viewed as: 
• Agent = Architecture + Agent Program 
• Architecture = the machinery that an agent executes on.


key: chroma:document
string_value:
• Agent Program = an implementation of an agent function. 
Simple Reflex Agents 
 They choose actions only based on the current percept.  
 They are rational only if a correct decision is made only on the basis of current precept.  
 Their environment is completely observable. 
Condition-Action Rule – It is a rule that maps a state (condition) to an action.  Artificial Intelligence  
  16 
 
Model-Based Reflex Agents


key: chroma:document
string_value:
16 
 
Model-Based Reflex Agents  
They use a model of the world to choose their actions. They maintain an internal state.  
Model: knowledge about “how the things happen in the world”. 
Internal State: It is a representation of unobserved aspects of current state depending on 
percept history. 
Updating state requires the information about 
 How the world evolves. 
 How the agent’s actions affect the world. 
 
 Artificial Intelligence  
  17 
 
Goal-Based Agents


key: chroma:document
string_value:
17 
 
Goal-Based Agents 
They choose their actions in order to achieve goals. Goal-based approach is more flexible than 
reflex agent since the knowledge supporting a decision is explicitly modeled, thereby allowing 
for modifications. 
 Goal: It is the description of desirable situations. 
 
Utility-Based Agents  
They choose actions based on a preference (utility) for each state. 
 Artificial Intelligence  
  18 
Goals are inadequate when:


key: chroma:document
string_value:
18 
Goals are inadequate when: 
 There are conflicting goals only some of which can be achieved. 
 Goals have some uncertainty of being achieved and one needs to  weigh likelihood of 
success against the importance of a goal. 
 
 
The Nature of Environments 
Some programs operate in the entirely artificial environment confined to keyboard input, 
database, computer file systems and character output on a screen.


key: chroma:document
string_value:
In contrast, some software agents (software robots or softbots) exist in rich, unlimited 
softbots domains. The simulator has a very detailed, complex environment. The software 
agent needs to choose from a long array of actions in real time. A softbot designed to scan  
the online preferences of the customer and show interesting items to the customer works in 
the real as well as an artificial environment. 
The most famous artificial environment is the Turing Test environment , in which one


key: chroma:document
string_value:
real and other artificial agents are tested on equal ground. This is a very ch allenging 
environment as it is highly difficult for a software agent to perform as well as a human. 
Turing Test  
The success of an intelligent behavior of a system can be measured with Turing Test.  
Two persons and a machine to be evaluated participate in the test.  Out of the two persons, 
one plays the role of the tester. Each of them sits in different rooms. The tester is unaware of


key: chroma:document
string_value:
who is machine and who is a human. He interrogates the questions by typing and sending 
them to both intelligences, to which he receives typed responses.  
 Artificial Intelligence  
  19 
This test aims at fooling the tester. If the tester fails to determine machine’s response from 
the human response, then the machine is said to be intelligent.   
Properties of Environment 
The environment has multifold properties:


key: chroma:document
string_value:
The environment has multifold properties: 
 Discrete / Continuous:  If there are a limited number of distinct, clearly defined, 
states of the environment, the environment is discrete (For example, chess); otherwise 
it is continuous (For example, driving).  
 
 Observable / Partially Observable: If it is possible to determine the complete state 
of the environment at each time point from the percepts it is observable; otherwise it 
is only partially observable.


key: chroma:document
string_value:
is only partially observable.  
 
 Static / Dynamic: If the environment does not change while an agent is acting, then 
it is static; otherwise it is dynamic. 
 
 Single agent / Multiple agents : The environment may contain other agents which 
may be of the same or different kind as that of the agent. 
 
 Accessible vs. inaccessible: If the agent’s sensory apparatus can have access to the 
complete state of the environment, then the environment is accessible to that agent.


key: chroma:document
string_value:
 Deterministic vs. Non-deterministic: If the next state of the environment is 
completely determined by the current state and the actions of the agent, then the 
environment is deterministic; otherwise it is non-deterministic. 
 
 Episodic vs. Non-episodic: In an episodic environment, each episode consists of the 
agent perceiving and then acting. The quality of its action depends just on the episode 
itself. Subsequent episodes do not depend on the actions in the previous episodes.


key: chroma:document
string_value:
Episodic environments are much simpler because the agent does not need to think 
ahead.  Artificial Intelligence  
  20 
Searching is the universal technique of problem solving in AI. There are some single-player 
games such as tile games, Sudoku, crossword, etc. The search algorithms help you to search 
for a particular position in such games.  
Single Agent Pathfinding Problems  
The games such as 3X3 eight-tile, 4X4 fifteen-tile, and 5X5 twenty four tile puzzles are single-


key: chroma:document
string_value:
agent-path-finding challenges. They consist of a matrix of tiles with a blank tile. The player is 
required to arrange the tiles by sliding a tile either vertically or horizontally into a blank space 
with the aim of accomplishing some objective.  
The other examples of single agent  pathfinding problems are Travelling Salesman Problem, 
Rubik’s Cube, and Theorem Proving. 
Search T erminology 
Problem Space: It is the environment in which the search takes place. ( A set of states and


key: chroma:document
string_value:
set of operators to change those states) 
Problem Instance: It is Initial state + Goal state 
Problem Space Graph : It represents problem state. States are shown by nodes and 
operators are shown by edges. 
Depth of a problem: Length of a shortest path or shortest sequence of operators from Initial 
State to goal state.  
Space Complexity: The maximum number of nodes that are stored in memory. 
Time Complexity: The maximum number of nodes that are created.


key: chroma:document
string_value:
Admissibility: A property of an algorithm to always find an optimal solution. 
Branching Factor: The average number of child nodes in the problem space graph. 
Depth: Length of the shortest path from initial state to goal state. 
Brute-Force Search Strategies 
They are most simple, as they do not need any domain -specific knowledge. They work fine 
with small number of possible states. 
Requirements –  
 State description 
5. Popular Search Algorithms  Artificial Intelligence  
  21


key: chroma:document
string_value:
21 
 A set of valid operators 
 Initial state 
 Goal state description 
Breadth-First Search 
It starts from the root node, explores the neighboring nodes first and moves towards the next 
level neighbors.  It generates one  tree at a time until the solution is found. It can be 
implemented using FIFO queue data structure. This method provides shortest path to the 
solution.  
If branching factor (average number of child nodes for a given node) = b and depth = d,


key: chroma:document
string_value:
then number of nodes at level d = bd. 
The total no of nodes created in worst case is b + b2 + b3 + … + bd. 
Disadvantage: Since each level of nodes is saved for creating next one, it consumes a lot of 
memory space. Space requirement to store nodes is exponential. 
Its complexity depends on the number of nodes. It can check duplicate nodes. 
 
Depth-First Search 
It is implemented in recursion with LIFO stack data structure. It creates the same set of nodes


key: chroma:document
string_value:
as Breadth-First method, only in the different order. 
As the nodes on the single path are stored in each iteration from root to leaf node, the space 
requirement to store nodes is linear.  With branching factor b and depth as m, the storage 
space is bm. 
Disadvantage: This algorithm may not terminate and go on infinitely on one  path. The 
solution to this issue is to choose a cut -off depth. If the ideal cut -off is d, and if chosen cut-


key: chroma:document
string_value:
off is lesser than d, then this algo rithm may fail. If chosen cut -off is more  than d, then 
execution time increases. 
Its complexity depends on the number of paths. It cannot check duplicate nodes. 
 Artificial Intelligence  
  22 
 
Bidirectional Search 
It searches forward from initial state and backward from goal state till both meet to identify 
a common state.  
The path from initial state is concatenated with the inverse path from the goal state. Each


key: chroma:document
string_value:
search is done only up to half of the total path. 
Uniform Cost Search 
Sorting is done in increasing cost of the path to a node. It always expands the least cost node. 
It is identical to Breadth First search if each transition has the same cost. 
It explores paths in the increasing order of cost.  
Disadvantage: There can be multiple long paths with the cost ≤ C*. Uniform Cost search 
must explore them all. 
Iterative Deepening Depth-First Search


key: chroma:document
string_value:
Iterative Deepening Depth-First Search 
It performs depth-first search to level 1, st arts over, executes a complete depth -first search 
to level 2, and continues in such way till the solution is found.  
It never creates a node until all lower nodes are generated. It only saves a stack of nodes. 
The algorithm ends when it finds a solution at depth d. The number of nodes created at depth 
d is bd and at depth d-1 is bd-1. 
 
 Artificial Intelligence  
  23


key: chroma:document
string_value:
Artificial Intelligence  
  23 
 
Comparison of Various Algorithms Complexities 
Let us see the performance of algorithms based on various criteria:  
Criterion Breadth 
First 
Depth 
First Bidirectional Uniform 
Cost 
Iterative 
Deepening 
Time bd bm b d/2 bd bd 
Space bd bm b d/2 bd bd 
Optimality Y N Y Y Y 
Completeness Y N Y Y Y 
Informed (Heuristic) Search Strategies 
To solve large problems with large number of possible states, problem-specific knowledge


key: chroma:document
string_value:
needs to be added to increase the efficiency of search algorithms. 
Heuristic Evaluation Functions 
They calculate the cost of optimal path between two states. A heuristic function for sliding -
tiles games is computed by counting number of moves that each tile makes from its goal state 
and adding these number of moves for all tiles. 
Pure Heuristic Search 
It expands nodes in the order of their heuristic values. It creates two lists, a closed list for the


key: chroma:document
string_value:
already expanded nodes and an open list for the created but unexpanded nodes. 
In each iteration, a node with a minimum heuristic value is expanded, all its child nodes are 
created and placed in the closed list. Then, the heuristic function is applied to the child nodes 
and they are placed in the open list according to  their heuristic value. The shorter paths are 
saved and the longer ones are disposed.  
 Artificial Intelligence  
  24 
A* Search


key: chroma:document
string_value:
Artificial Intelligence  
  24 
A* Search 
It is best -known form of Best First search. It avoids expanding paths that are already 
expensive, but expands most promising paths first.  
f(n) = g(n) + h(n), where  
• g(n) the cost (so far) to reach the node  
• h(n) estimated cost to get from the node to the goal  
• f(n) estimated total cost of path through n to goal. It is implemented using priority queue 
by increasing f(n). 
Greedy Best First Search


key: chroma:document
string_value:
by increasing f(n). 
Greedy Best First Search  
It expands the node that is estimated to be closest to goal. It expands nodes based on f(n) = 
h(n). It is implemented using priority queue.  
Disadvantage: It can get stuck in loops. It is not optimal. 
Local Search Algorithms   
They start from a prospective solution and then  move to a  neighboring solution. They can 
return a valid solution even if it is interrupted at any time before they end. 
Hill-Climbing Search


key: chroma:document
string_value:
Hill-Climbing Search  
It is an iterative algorithm that starts with an arbitrary solution to a problem and attempts to 
find a better solution by changing a single element of the solution incrementally. If the change 
produces a better solution, an incremental change is taken as a new solution. This process is 
repeated until there are no further improvements. 
function Hill-Climbing (problem), returns a state that is a local maximum. 
inputs: problem, a problem


key: chroma:document
string_value:
inputs: problem, a problem  
local variables: current, a node  
                      neighbor, a node  
current ←Make_Node(Initial-State[problem])  
loop  
    do neighbor ← a highest_valued successor of current  
         if Value[neighbor] ≤ Value[current] then  
         return State[current]  
         current ← neighbor  
end 
Disadvantage: This algorithm is neither complete, nor optimal.  Artificial Intelligence  
  25 
Local Beam Search


key: chroma:document
string_value:
25 
Local Beam Search  
In this algorithm, it holds k number of states at any given time. At the start, these states are 
generated randomly. The successors of these k states are computed with the help of objective 
function. If any of these successors is the maximum value of the objective function, then the 
algorithm stops.  
Otherwise the (initial k states and k number of successors of the states = 2k) states are placed


key: chroma:document
string_value:
in a pool. The pool is then sorted numerically. The highest k states are selected as new initial 
states. This process continues until a maximum value is reached.  
function BeamSearch( problem, k), returns a solution state.  
start with k randomly generated states  
loop  
     generate all successors of all k states  
     if any of the states = solution, then return the state 
     else select the k best successors 
end 
Simulated Annealing


key: chroma:document
string_value:
end 
Simulated Annealing 
Annealing is the process of heating and cooling a metal to change its internal structure for 
modifying its physical properties. When the metal cools, its new structure is seized, and the 
metal retains its newly obtained properties. In simulated annealing process, the temperature 
is kept variable.  
We initially set the temperature high and then allow it to ‘cool' slowly as the algorithm


key: chroma:document
string_value:
proceeds. When the temperature is high , the algorithm is allowed to accept worse solutions 
with high frequency.  
Start 
5. Initialize k = 0; L = integer number of variables; 
6. From i -> j, search the performance difference ∆. 
7. If ∆ <= 0 then accept else if exp(-/T(k)) > random(0,1) then accept; 
8. Repeat steps 1 and 2 for L(k) steps. 
9. k = k + 1; 
Repeat steps 1 through 4 till the criteria is met. 
End 
Travelling Salesman Problem


key: chroma:document
string_value:
End 
Travelling Salesman Problem 
In this algorithm, the objective is to find a low-cost tour that starts from a city, visits all cities 
en-route exactly once and ends at the same starting city. 
Start 
   Find out all (n -1)! Possible solutions, where n is the total number of cities.  Artificial Intelligence  
  26 
   Determine the minimum cost by finding out the cost of each of these (n -1)!     
   solutions. 
   Finally, keep the one with the minimum cost. 
end


key: chroma:document
string_value:
end 
  
 Artificial Intelligence  
  27 
Fuzzy Logic Systems (FLS) produce acceptable but definite output in response to incomplete, 
ambiguous, distorted, or inaccurate (fuzzy) input. 
What is Fuzzy Logic? 
Fuzzy Logic (FL) is a method of reasoning that resembles human reasoning . The approach of 
FL imitates the way of decision making in humans  that involves all intermediate possibilities 
between digital values YES and NO.


key: chroma:document
string_value:
between digital values YES and NO.  
The conventional logic block that a computer can understand takes precise input and produces 
a definite output as TRUE or FALSE, which is equivalent to human’s YES or NO.  
The inventor of fuzzy logic, Lotfi Zadeh, observed that unlike computers, the human decision 
making includes a range of possibilities between YES and NO, such as: 
CERTAINLY YES 
POSSIBLY YES 
CANNOT SAY 
POSSIBLY NO 
CERTAINLY NO


key: chroma:document
string_value:
CANNOT SAY 
POSSIBLY NO 
CERTAINLY NO 
 
The fuzzy logic works on the levels of possibilities of input to achieve the definite output.  
Implementation 
 It can be implemented in systems with various sizes and capabilities ranging from small 
micro-controllers to large, networked, workstation-based control systems.  
 It can be implemented in hardware, software, or a combination of both.  
Why Fuzzy Logic? 
Fuzzy logic is useful for commercial and practical purposes.


key: chroma:document
string_value:
 It can control machines and consumer products. 
 It may not give accurate reasoning, but acceptable reasoning. 
 Fuzzy logic helps to deal with the uncertainty in engineering.  
6. Fuzzy Logic Systems  Artificial Intelligence  
  28 
Fuzzy Logic Systems Architecture 
It has four main parts as shown: 
1. Fuzzification Module: transforms the system inputs, which are crisp numbers, into 
fuzzy sets.  
It splits the input signal into five steps such as: 
LP x is Large Positive


key: chroma:document
string_value:
LP x is Large Positive  
MP x is Medium Positive 
S x is Small 
MN x is Medium Negative 
LN x is Large Negative 
2. Knowledge Base: It stores IF-THEN rules provided by experts. 
3. Inference E ngine: It simulates the human reasoning process by making fuzzy 
inference on the inputs and IF-THEN rules. 
4. Defuzzification Module: It transforms the fuzzy set obtained by the inference engine 
into a crisp value. 
 
These membership functions work on fuzzy sets of variables. 
Membership Functions


key: chroma:document
string_value:
Membership Functions 
Membership functions allow you  to quantify linguistic term and represent a fuzzy set 
graphically. A membership function  for a fuzzy set A on the universe of discourse X is 
defined as µA:X → [0,1].  
 Artificial Intelligence  
  29 
Here, each element of X is mapped to a value between 0 and 1. It is called membership 
value or degree of membership. It quantifies the degree of membership of the element in X 
to the fuzzy set A.


key: chroma:document
string_value:
to the fuzzy set A. 
 x axis represents the universe of discourse. 
 y axis represents the degrees of membership in the [0, 1] interval. 
There can be multiple membership functions applicabl e to fuzzify a nume rical value. Simple 
membership functions are used as use of complex functions does not add more precision  in 
the output. 
All membership functions for LP, MP, S, MN, and LN are shown as below: 
 
The triangular membership function shapes are most common amon g various other


key: chroma:document
string_value:
membership function shapes such as trapezoidal, singleton, and Gaussian. 
Here, the input to 5-level fuzzifier varies from -10 volts to +10 volts. Hence the corresponding 
output also changes. 
Example of a Fuzzy Logic System 
Let us consider an air conditioning system with 5-lvel fuzzy logic system. This system adjusts 
the temperature of air conditioner by comparing the room temperature and the target 
temperature value.  
 Artificial Intelligence  
  30 
 
Algorithm


key: chroma:document
string_value:
Artificial Intelligence  
  30 
 
Algorithm  
1. Define linguistic Variables and terms (start) 
2. Construct membership functions for them. (start)  
3. Construct knowledge base of rules (start) 
4. Convert crisp data into fuzzy data sets using membership functions (fuzzification) 
5. Evaluate rules in the rule base (inference engine) 
6. Combine results from each rule (inference engine) 
7. Convert output data into non-fuzzy values. (defuzzification) 
Development


key: chroma:document
string_value:
Development 
Step 1: Define linguistic variables and terms 
Linguistic variables are input and output variables in the form of simple words or sentences. 
For room temperature, cold, warm, hot, etc., are linguistic terms. 
Temperature (t) = {very-cold, cold, warm, very-warm, hot} 
Every member of this set is a linguistic term and it can cover some portion of overall 
temperature values. 
Step 2: Construct membership functions for them


key: chroma:document
string_value:
Step 2: Construct membership functions for them 
The membership functions of temperature variable are as shown: 
 
 Artificial Intelligence  
  31 
 
Step3: Construct knowledge base rules 
Create a matrix of room temperature values versus target temperature values that an air 
conditioning system is expected to provide. 
RoomTemp/Target Very_Cold Cold Warm Hot Very_Hot 
Very_Cold No_Change Heat Heat Heat Heat 
Cold Cool No_Change Heat Heat Heat 
Warm Cool Cool No_Change Heat Heat


key: chroma:document
string_value:
Warm Cool Cool No_Change Heat Heat 
Hot Cool Cool Cool No_Change Heat 
Very_Hot Cool Cool Cool Cool No_Change 
 
Build a set of rules into the knowledge base in the form of IF-THEN-ELSE structures. 
Sr. No. Condition Action 
1 IF temperature=(Cold OR Very_Cold) AND target=Warm THEN HEAT 
2 IF temperature=(Hot OR Very_Hot) AND target=Warm THEN COOL 
3 IF (temperature=Warm) AND (target=Warm) THEN NOCHANGE 
 
Step5 
 Artificial Intelligence  
  32


key: chroma:document
string_value:
Step5 
 Artificial Intelligence  
  32 
Fuzzy set operations perform evaluation of rules. The operations used for OR and AND are 
Max and Min respectively.  All results of evaluation are combined to form a final result. This 
result is a fuzzy value. 
Step 6 
Defuzzification is then performed according to membership function for output variable. 
 
Application Areas of Fuzzy Logic 
The key application areas of fuzzy logic are as given: 
Automotive Systems 
 Automatic Gearboxes


key: chroma:document
string_value:
Automotive Systems 
 Automatic Gearboxes 
 Four-Wheel Steering 
 Vehicle environment control 
Consumer Electronics 
 Hi-Fi Systems 
 Photocopiers 
 Still and Video Cameras 
 Television 
Domestic Goods 
 Microwave Ovens 
 Refrigerators 
 Toasters 
 Vacuum Cleaners 
 Artificial Intelligence  
  33 
 Washing Machines 
Environment Control 
 Air Conditioners/Dryers/Heaters 
 Humidifiers 
Advantages of FLSs 
 Mathematical concepts within fuzzy reasoning are very simple.


key: chroma:document
string_value:
 You can modify a FIS by just adding or deleting rules due to flexibility of fuzzy logic. 
 Fuzzy logic Systems can take imprecise, distorted, noisy input information. 
 FLSs are easy to construct and understand. 
 Fuzzy logic is a solution to complex problems in all fields of life, including medicine, as 
it resembles human reasoning and decision making.  
Disadvantages of FLSs 
 There is no systematic approach to fuzzy system designing. 
 They are understandable only when simple.


key: chroma:document
string_value:
 They are understandable only when simple. 
 They are suitable for the problems which do not need high accuracy.  
   Artificial Intelligence  
  34 
Natural Language Processing (NLP) refers to AI method of communicating with an intelligent 
systems using a natural language such as English. 
Processing of Natural Language is required when you want an intelligent system like robot to 
perform as per your instructions, when you want to hear decision from a dialogue based


key: chroma:document
string_value:
clinical expert system, etc. 
The field of NLP involves making computers to perform useful tasks with the natural languages 
humans use. The input and output of an NLP system can be: 
 Speech 
 Written Text 
Components of NLP 
There are two components of NLP as given: 
Natural Language Understanding (NLU) 
Understanding involves the following tasks: 
 Mapping the given input in natural language into useful representations. 
 Analyzing different aspects of the language.


key: chroma:document
string_value:
 Analyzing different aspects of the language. 
Natural Language Generation (NLG) 
It is the process of producing meaningful phrases and sentences in the form of natural 
language from some internal representation.  
It involves: 
 Text planning: It includes retrieving the relevant content from knowledge base.  
 Sentence planning:  It includes choosing required words, forming meaningful 
phrases, setting tone of the sentence.


key: chroma:document
string_value:
phrases, setting tone of the sentence. 
 Text Realization: It is mapping sentence plan into sentence structure. 
The NLU is harder than NLG. 
Difficulties in NLU 
 NL has an extremely rich form and structure. 
 It is very ambiguous. There can be different levels of ambiguity: 
o Lexical ambiguity: It is at very primitive level such as word-level.  
7. Natural Language Processing  Artificial Intelligence  
  35 
o For example, treating the word “board” as noun or verb?


key: chroma:document
string_value:
o Syntax Level ambiguity: A sentence can be parsed in different ways.  
o For example, “He lifted the beetle with red cap.” – Did he use cap to lift the 
beetle or he lifted a beetle that had red cap? 
o Referential ambiguity: Referring to something using pronouns. For example, 
Rima went to Gauri. She said, “I am tired.” - Exactly who is tired? 
o One input can mean different meanings. 
o Many inputs can mean the same thing. 
NLP T erminology


key: chroma:document
string_value:
NLP T erminology 
 Phonology: It is study of organizing sound systematically. 
 Morphology: It is a study of construction of words from primitive meaningful units. 
 Morpheme: It is primitive unit of meaning in a language. 
 Syntax: It refers to arranging words to make a sentence. It also involves determining 
the structural role of words in the sentence and in phrases. 
 Semantics: It is concerned with the meaning of words and how to combine words into 
meaningful phrases and sentences.


key: chroma:document
string_value:
meaningful phrases and sentences. 
 Pragmatics: It deals with using and understanding sentences in different situations 
and how the interpretation of the sentence is affected. 
 Discourse: It deals with how the immediately preceding sentence can affect the 
interpretation of the next sentence. 
 World Knowledge: It includes the general knowledge about the world. 
Steps in NLP 
There are general five steps:  
1. Lexical Analysis


key: chroma:document
string_value:
1. Lexical Analysis 
It involves identifying and analyzing the structure of words. Lexicon of a language 
means the collection of words and phrases in a language. Lexical analysis is dividing 
the whole chunk of txt into paragraphs, sentences, and words. 
2. Syntactic Analysis (Parsing) 
It involves analysis of words in the sentence for grammar and arranging words in a 
manner that shows the relationship among the words. The sentence such as “The


key: chroma:document
string_value:
school goes to boy” is rejected by English syntactic analyzer.  Artificial Intelligence  
  36 
 
3. Semantic Analysis 
It draws the exact meaning or the dictionary meaning from the text. The text is 
checked for meaningfulness. It is done by mapping syntactic structures and objects in 
the task domain. The semantic analyzer disregards sentence such as “hot ice-cream”. 
4. Discourse Integration 
The meaning of any sentence depends upon the meaning of the sentence just before


key: chroma:document
string_value:
it. In addition, it also brings about the meaning of immediately succeeding sentence. 
5. Pragmatic Analysis 
During this, w hat was said is re -interpreted on what it actually meant. It involves 
deriving those aspects of language which require real world knowledge. 
Implementation Aspects of Syntactic Analysis 
There are a number of algorithms researchers have developed for syntactic analysis, but we 
consider only the following simple methods: 
 Context-Free Grammar 
 Top-Down Parser


key: chroma:document
string_value:
 Context-Free Grammar 
 Top-Down Parser 
Let us see them in detail: 
Context-Free Grammar  
It is the grammar that consists rules with a single symbol on the left-hand side of the rewrite 
rules. Let us create grammar to parse a sentence –  
“The bird pecks the grains” 
Articles (DET): a | an | the. 
 Artificial Intelligence  
  37 
Nouns: bird | birds | grain | grains 
Noun Phrase (NP): Article + Noun | Article + Adjective + Noun  
                              = DET N | DET ADJ N


key: chroma:document
string_value:
Verbs: pecks | pecking | pecked  
Verb Phrase (VP): NP V | V NP 
Adjectives (ADJ): beautiful | small | chirping 
The parse tree breaks down the sentence into structured parts so that the computer can easily 
understand and process it. In order for the pars ing algorithm to construct this parse tree, a 
set of rewrite rules, which describe what tree structures are legal, need to be constructed. 
These rules say that a certain symbol may be expanded in the tree by a sequence of other


key: chroma:document
string_value:
symbols. According to first order logic rule, ff there are two strings Noun Phrase (NP) and 
Verb Phrase (VP), then the string combined by NP followed by VP is a sentence. The rewrite 
rules for the sentence are as follows: 
 
S -> NP VP 
NP -> DET N | DET ADJ N 
VP -> V NP 
Lexocon: 
DET -> a | the 
ADJ -> beautiful | perching 
N -> bird | birds | grain | grains 
V -> peck | pecks | pecking  
 
The parse tree can be created as shown:   Artificial Intelligence  
  38


key: chroma:document
string_value:
38 
 
Now consider the above rewrite rules. Since  V can be replaced by both, "peck" or "pecks", 
sentences such as "The bird peck the grains" can be wrongly permitted. i. e. the subject-verb 
agreement error is approved as correct.  
Merit: The simplest style of grammar, therefore widely used one. 
Demerits: 
 They are not highly precise. For example, “The grains peck the bird”, is a syntactically 
correct according to parser, but even if it makes no sense, parser takes it as a correct


key: chroma:document
string_value:
sentence. 
 To bring out  high precision, multiple sets of grammar need to be prepared.  It may 
require a completely different sets of rules for parsing singular and plural variations, 
passive sentences, etc., which can lead to  creation of huge set of rules that are  
unmanageable.  
Top-Down Parser 
Here, the parser starts with the  S symbol and attempts to rewrite it into a sequence 
of terminal symbols that matches the classes of the words in the input sentence until it


key: chroma:document
string_value:
consists entirely of terminal symbols.  
These are then checked with the input sentence to see if it matched. If not, the process is 
started over again with a different set of rules. This is  repeated until a specific rule is found 
which describes the structure of the sentence.  
 Artificial Intelligence  
  39 
Merit: It is simple to implement. 
Demerits: 
 It is inefficient, as the search process has to be repeated if an error occurs.  
 Slow speed of working.   Artificial Intelligence


key: chroma:document
string_value:
40 
Expert systems (ES) are one of the prominent research domains of AI. It is introduced by the 
researchers at Stanford University, Computer Science Department. 
What are Expert Systems? 
The expert systems are the computer applications developed to solve complex problems in a 
particular domain, at the level of extra-ordinary human intelligence and expertise.  
Characteristics of Expert Systems 
 High performance 
 Understandable 
 Reliable 
 Highly responsive


key: chroma:document
string_value:
 Reliable 
 Highly responsive 
Capabilities of Expert Systems 
The expert systems are capable of: 
 Advising  
 Instructing and assisting human in decision making 
 Demonstrating  
 Deriving a solution 
 Diagnosing 
 Explaining  
 Interpreting input 
 Predicting results 
 Justifying the conclusion 
 Suggesting alternative options to a problem 
They are incapable of: 
 Substituting human decision makers 
 Possessing human capabilities


key: chroma:document
string_value:
 Possessing human capabilities 
 Producing accurate output for inadequate knowledge base 
 Refining their own knowledge 
8. Expert Systems  Artificial Intelligence  
  41 
Components of Expert Systems 
The components of ES include: 
 Knowledge Base  
 Inference Engine  
 User Interface  
Let us see them one by one briefly: 
 
Knowledge Base  
It contains domain-specific and high-quality knowledge.  
Knowledge is required to exhibit intelligence. The success of any ES majorly depends upon


key: chroma:document
string_value:
the collection of highly accurate and precise knowledge. 
What is Knowledge? 
The data is collection of facts. The information is organized as data and facts about the task 
domain. Data, information, and past experience  combined together are termed as 
knowledge.  
 
 
 
 Artificial Intelligence  
  42 
Components of Knowledge Base 
The knowledge base of an ES is a store of both, factual and heuristic knowledge.  
 Factual Knowledge  – It is the information widely accepted by the Knowledge


key: chroma:document
string_value:
Engineers and scholars in the task domain. 
 Heuristic Knowledge – It is about practice, accurate judgment, one’s ability of 
evaluation, and guessing. 
Knowledge representation 
It is the method used to organize and formalize the knowledge in the knowledge base. It is in 
the form of IF-THEN-ELSE rules.   
Knowledge Acquisition 
The success of any expert system majorly depends on the quality, completeness, and accuracy 
of the information stored in the knowledge base.


key: chroma:document
string_value:
The knowledge base is formed by readings from various experts, scholars, and the 
Knowledge Engineers. The knowledge engineer is a person with the qualities of empathy , 
quick learning, and case analyzing skills.  
He acquires information from subject expert by recording, interviewing, and observing him at 
work, etc. He then categorizes and organizes the information in a meaningful way, in the form 
of IF-THEN-ELSE rules, to be used by interference machine. The knowledge engineer also


key: chroma:document
string_value:
monitors the development of the ES. 
Inference Engine 
Use of efficient procedures and rules by the Inf erence Engine is essential in deducting a 
correct, flawless solution.  
In case of knowledge-based ES, the Inference Engine acquires and manipulates the knowledge 
from the knowledge base to arrive at a particular solution.  
In case of rule based ES, it: 
 Applies rules repeatedly to the facts, which are obtained from earlier rule application.


key: chroma:document
string_value:
 Adds new knowledge into the knowledge base if required. 
 Resolves rules conflict when multiple rules are applicable to a particular case  
To recommend a solution, the inference engine uses the following strategies: 
 Forward Chaining 
 Backward Chaining 
Forward Chaining 
It is a strategy of an expert system to answer the question, “What can happen next?”  Artificial Intelligence  
  43 
Here, the inferance engine follows the chain of conditions and derivations and finally deduces


key: chroma:document
string_value:
the outcome. It considers all the facts and rules, and sorts them before  concluding to a 
solution.  
This strategy is followed for working on conclusion, result, or effect.  For example, prediction 
of share market status as an effect of changes in interest rates.  
 
Backward Chaining 
With this strategy, an expert system finds ou t the answer to the question , “Why this 
happened?” 
On the basis of what has already happen ed, the in ference engine tries to find out which


key: chroma:document
string_value:
conditions could have happened in the past for this result. This strategy is followed for finding 
out cause or reason. For example, diagnosis of blood cancer in humans.  
 
User Interface 
User interface provides interaction between user of the ES and the ES itself. It is generally 
Natural Language Processing so as to be used by the user who is well -versed in the task 
domain. The user of the ES need not be necessarily an expert in Artificial Intelligence.


key: chroma:document
string_value:
It explains how the ES has arrived at a particular recommendation. The explanation may in 
the following forms: 
 Natural language displayed on screen 
 Verbal narrations in natural language  
 Artificial Intelligence  
  44 
 Listing of rule numbers displayed on the screen.  
The user interface makes it easy to trace the credibility of the deductions. 
Requirements of Efficient ES User Interface  
 It should help users to accomplish their goals in shortest possible ay.


key: chroma:document
string_value:
 It should be designed to work for user’s existing or desired work practices. 
 Its technology should be adaptable to user’s requirements; not the other way round.  
 It should make efficient use of user input. 
Expert Systems Limitations 
No technology can offer easy and complete solution. Large systems are costly , require 
significant development time , and computer resources. ESs have their limitations which 
include: 
 Limitations of the technology 
 Difficult knowledge acquisition


key: chroma:document
string_value:
 Difficult knowledge acquisition  
 ES are Difficult to maintain 
 High Development costs 
Applications of Expert System  
The following table shows where ES can be applied.  
Application Description 
Design Domain Camera lens design, automobile design. 
Medical Domain Diagnosis Systems to deduce cause of  disease from observ ed 
data, conduction medical operations on humans. 
Monitoring Systems  
Comparing data continu ously with observed system or with


key: chroma:document
string_value:
prescribed behavior such as leakage monitoring in long 
petroleum pipeline. 
Process Control Systems Controlling a physical process based on monitoring. 
Knowledge Domain Finding out faults in vehicles, computers. 
Finance/Commerce Detection of possible fraud, suspicious transactions, stock 
market trading, Airline scheduling, cargo scheduling.  Artificial Intelligence  
  45 
Expert System T echnology


key: chroma:document
string_value:
45 
Expert System T echnology  
There are several levels of ES technologies available. Expert systems technologies include: 
1. Expert System Development Environment : The ES development environment 
includes hardware and tools. They are: 
o Workstations, minicomputers, mainframes  
o High level Symbolic Programming Languages such as LISt Programming (LISP) 
and PROgrammation en LOGique (PROLOG). 
o Large databases


key: chroma:document
string_value:
o Large databases 
2. Tools: They reduce the effort and cost involved in developing an expert system to 
large extent. 
o Powerful editors and debugging tools with multi-windows. 
o They provide rapid prototyping 
o Have Inbuilt definitions of model, knowledge representation , and inference 
design. 
1. Shells: A shell is nothing but an  expert system without knowledge base. A shell 
provides the developers with knowledge acquisition, inference engine, user interface,


key: chroma:document
string_value:
and explanation facility. For example, few shells are given below:  
o Java Expert System Shell (JESS) that provides fully developed Java API for 
creating an expert system. 
o Vidwan, a shell developed at the National Centre for Softw are Te chnology, 
Mumbai in 1993. It enables knowledge encoding in the form of IF-THEN rules.  
Development of Expert Systems: General Steps  
The process of ES development is iterative. Steps in developing the ES include: 
1. Identify Problem Domain


key: chroma:document
string_value:
1. Identify Problem Domain 
 The problem must be suitable for an expert system to solve it. 
 Find the experts in task domain for the ES project. 
 Establish cost-effectiveness of the system. 
2. Design the System 
 Identify the ES Technology. 
 Know and establish the degree of integration with the other systems and databases. 
 Realize how the concepts can represent the domain knowledge best.   Artificial Intelligence  
  46 
3. Develop the Prototype


key: chroma:document
string_value:
46 
3. Develop the Prototype 
    Form Knowledge Base: The knowledge engineer works to: 
     Acquire domain knowledge from the expert. 
     Represent it in the form of If-THEN-ELSE rules. 
4. Test and Refine the Prototype 
 The knowledge engineer uses sample cases to test the prototype for any deficiencies 
in performance.  
 End users test the prototypes of the ES. 
5. Develop and Complete the ES


key: chroma:document
string_value:
5. Develop and Complete the ES 
 
 Test and ensure the interaction of the  ES with all elements of its environment,  including end users, 
databases, and other information systems. 
 Document the ES project well. 
 Train the user to use ES. 
6. Maintain the System 
 Keep the knowledge base up-to-date by regular review and update. 
 Cater for new interfaces with other information systems, as those systems evolve. 
Benefits of Expert Systems


key: chroma:document
string_value:
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.


key: chroma:document
string_value:
 Steady response: They work steadily without getting motional, tensed or fatigued. 
 
 
 
 
   Artificial Intelligence  
  47 
Robotics is a domain in artificial intelligence that deals with the study of creating intelligent 
and efficient robots. 
What are Robots? 
Robots are the artificial agents acting in real world environment.  
Objective 
Robots are aimed at manipulating the objects by perceiving, picking, moving, modifying the


key: chroma:document
string_value:
physical properties of object, destroying it, or to have an effect thereby freeing manpower 
from doing repetitive functions without getting bored, distracted, or exhausted.  
What is Robotics? 
Robotics is a branch of AI, which is composed of Electrical Engineering, Mechanical 
Engineering, and Computer Science for designing, construction, and application of robots.  
Aspects of Robotics 
 The robots have mechanical construction, form, or shape designed to accomplish a 
particular task.


key: chroma:document
string_value:
particular task. 
 They have electrical components which power and control the machinery. 
 They contain some level of computer program that determines what, when and how 
a robot does something. 
Difference in Robot System and Other AI Program 
Here is the difference between the two: 
AI Programs Robots 
They usually operate in computer-stimulated 
worlds. They operate in real physical world 
The input to an AI program is in symbols and 
rules.


key: chroma:document
string_value:
rules. 
Inputs to robots is analog signal in the form of 
speech waveform or images 
They need general purpose computers to 
operate on. 
They need special hardware with sensors and 
effectors. 
9. Robotics  Artificial Intelligence  
  48 
Robot Locomotion 
Locomotion is the mechanism that makes a robot capable of moving in its environment. There 
are various types of locomotions: 
 Legged 
 Wheeled 
 Combination of Legged and Wheeled Locomotion 
 Tracked slip/skid  
Legged Locomotion


key: chroma:document
string_value:
 Tracked slip/skid  
Legged Locomotion 
 This type of locomotion consumes more power while demonstrating walk, jump, trot, 
hop, climb up or down, etc.  
 It requires more number of motors to accomplish a movement. It is suited for rough 
as well as smooth terrain where irregular or too smooth surface makes it consume 
more power for a wheeled locomotion. It is little difficult to implement be cause of 
stability issues.


key: chroma:document
string_value:
stability issues. 
 It comes with the variety of one, two, four, and six legs.  If a robot has multiple legs 
then leg coordination is necessary for locomotion.  
The total number of possible gaits (a periodic sequence of lift and release events for ea ch of 
the total legs) a robot can travel depends upon the number of its legs.  
If a robot has k legs, then the number of possible events N = (2k-1)!. 
In case of a two-legged robot (k=2), the number of possible events is N = (2k-1)!


key: chroma:document
string_value:
= (2*2-1)! = 3! = 6.  
Hence there are six possible different events: 
1. Lifting the Left leg  
2. Releasing the Left leg  
3. Lifting the Right leg  
4. Releasing the Right leg  
5. Lifting both the legs together  
6. Releasing both the legs together. 
In case of k=6 legs , there are 39916800 possible events. Hence the complexity of robots is 
directly proportional to the number of legs.  Artificial Intelligence  
  49 
 
Wheeled Locomotion


key: chroma:document
string_value:
49 
 
Wheeled Locomotion 
It requires fewer number of motors to accomplish a movement.  It is little easy to implement 
as there are less stability issues in c ase of more number of wheels. It is power efficient as 
compared to legged locomotion. 
 Standard wheel: Rotates around the wheel axle and around the contact 
 Castor wheel: Rotates around the wheel axle and the offset steering joint  
 Swedish 45° and Swedish 90 ° wheels: Omni-wheel, rotates around the contact


key: chroma:document
string_value:
point, around the wheel axle, and around the rollers.  
 Ball or spherical wheel: Omnidirectional wheel, technically difficult to implement. 
 
Slip/Skid Locomotion 
In this type, the vehicles use tracks as in a  tank. The robot is steered by moving the tracks 
with different speeds in the same or opposite direction.  It offers stability because of large 
contact area of track and ground. 
 
 Artificial Intelligence  
  50 
Components of a Robot 
Robots are constructed with the following:


key: chroma:document
string_value:
Robots are constructed with the following: 
 Power Supply : The robots are powered by batteries, solar power, hydraulic, or 
pneumatic power sources.  
 Actuators: They convert energy into movement. 
 Electric motors (AC/DC): They are required for rotational movement. 
 Pneumatic Air Muscles: They contract almost 40% when air is sucked in them. 
 Muscle Wires: They contract by 5% when electric current is passed through them.


key: chroma:document
string_value:
 Piezo Motors and Ultrasonic Motors: Best for industrial robots. 
 Sensors: They provide knowledge of real time information on the task  environment. 
Robots are equipped with vision sensors  to be to compute the depth in the 
environment. A tactile sensor imitates the mechanical properties of touch receptors of 
human fingertips.  
Computer Vision 
This is a technology of AI with which the robots can see. The computer vision plays vital role


key: chroma:document
string_value:
in the domains of safety, security, health, access, and entertainment. 
Computer vision automatically extracts, analyzes, and comprehends useful information from 
a single image or an array of images. This process involves development of algorithm s to 
accomplish automatic visual comprehension. 
Hardware of Computer Vision System 
This involves: 
 Power supply 
 Image acquisition device such as camera 
 a processor  
 a software  
 A display device for monitoring the system


key: chroma:document
string_value:
 A display device for monitoring the system 
 Accessories such as camera stands, cables, and connectors 
T asks of Computer Vision 
OCR: In the domain of computers, Optical Character Reader, a software  to convert scanned 
documents into editable text, which accompanies a scanner.  Artificial Intelligence  
  51 
Face Detection:  Many state-of-the-art cameras come with this feature , which enables to


key: chroma:document
string_value:
read the face and take the picture of that perfect expression . It is used to let a user access 
the software on correct match.  
Object Recognition: They are installed in supermarkets, cameras , high-end cars such as 
BMW, GM, and Volvo. 
Estimating Position:  It is estimating position of a n object with respect to camera as in 
position of tumor in human’s body. 
Application Domains of Computer Vision 
 agriculture 
 autonomous vehicles 
 biometrics 
 character recognition


key: chroma:document
string_value:
 biometrics 
 character recognition 
 forensics, security, and surveillance 
 industrial quality inspection 
 face recognition 
 gesture analysis 
 geoscience 
 medical imagery 
 pollution monitoring 
 process control  
 remote sensing 
 robotics 
 transport 
Applications of Robotics 
The robotics has been instrumental in the various domains such as: 
 Industries: Robots are used for h andling material, cutting, welding, color coating, 
drilling, polishing, etc.


key: chroma:document
string_value:
drilling, polishing, etc. 
 Military: Autonomous robots can reach inaccessible and hazardous zones during war. 
A robot named Daksh, developed by Defense Research and Development Organization 
(DRDO), is in function to destroy life-threatening objects safely. 
 Medicine: The robots are capable of carrying out hundreds of clinical tests 
simultaneously, rehabilitating permanently disabled people, and performing complex 
surgeries such as brain tumors.  Artificial Intelligence  
  52


key: chroma:document
string_value:
52 
 Exploration: The robot rock climbers used for space exploration, underwater drones 
used for ocean exploration are to name a few. 
 Entertainment: Disney’s engineers have created hundreds of robots for movie 
making. 
 
   Artificial Intelligence  
  53 
Yet another research area in AI, neural networks, is inspired from the natural neural network 
of human nervous system.  
What are Artificial Neural Networks (ANNs)?


key: chroma:document
string_value:
What are Artificial Neural Networks (ANNs)? 
The inventor of the first neurocomputer, 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.” 
Basic Structure of ANNs 
The idea of ANNs is  based on the belief that working of human brain by making the right


key: chroma:document
string_value:
connections, can be imitated using silicon and wires as living neurons and dendrites. 
The human brain is composed of 100 billion nerve cells  called neurons. They are connected 
to other thousand cells by Axons. Stimuli from external environment or inputs from sensory 
organs are accepted by dendrites. These inputs create electric impulses, which quickly travel 
through the neural network. A neuron can then send the message to other neuron to handle  
the issue or does not send it forward.


key: chroma:document
string_value:
the issue or does not send it forward. 
 
ANNs are composed of multiple nodes, which imitate biological neurons of human brain. The 
neurons are connected by links and they interact with each other. The nodes can take input 
10. Neural Networks  Artificial Intelligence  
  54 
data and perform simple operation s on the data. The result of these operations is passed t o 
other neurons. The output at each node is called its activation or node value.


key: chroma:document
string_value:
Each link is associated with weight. ANNs are capable of learning, which takes place by 
altering weight values. The following illustration shows a simple ANN: 
 
T ypes of Artificial Neural Networks 
There are two Artificial Neural Network topologies: FeedForward and Feedback. 
FeedForward ANN 
In this ANN, the information flow is unidirectional. A unit sends information to other unit from 
which it does not receive any information. There are no feedback loops. They are used in


key: chroma:document
string_value:
pattern generation/recognition/classification. They have fixed inputs and outputs. 
 
Feedback ANN 
Here, feedback loops are allowed. They are used in content addressable memories. 
 Artificial Intelligence  
  55 
 
Working of ANNs  
In the topology diagrams shown , each arrow represents a connection between two neurons 
and indicates the pathway for the flow of information. Each connection has a weight, an integer 
number that controls the signal between the two neurons.


key: chroma:document
string_value:
If the network generates a “good or desired” output, there is no need to adjust the weights. 
However, if the network generates a “poor or undesired” output or an error, then the system 
alters the weights in order to improve subsequent results. 
Machine Learning in ANNs 
ANNs are capable of learning  and they need to be trained . There are several learning 
strategies: 
 Supervised Learning: It involves a teacher that is scholar than the ANN itself. For


key: chroma:document
string_value:
example, the teacher feeds some example data about which the teacher already knows 
the answers.  
For example, pattern recognizing. The ANN comes up with guesses while recognizing. 
Then the teacher provides the ANN with the answers. The network then compares it 
guesses with the teacher’s “correct” answers and makes adjustments according to 
errors.  
 Unsupervised Learning: It is required when there is no example data set with known


key: chroma:document
string_value:
answers. For example, searching for a hidden pattern . In this case, clustering i.e.  
dividing a set of elements into groups according to some unknown pattern  is carried 
out based on the existing data sets present.  
 Artificial Intelligence  
  56 
 Reinforcement Learning : This strategy built on observation. The ANN  makes a 
decision by observing its environment . If  the observation is negative, the ne twork


key: chroma:document
string_value:
adjusts its weights to be able to make a different required decision the next time.  
Back Propagation Algorithm 
It is the training or learning algorithm. It learns by example. If you submit to the algorithm 
the example of what you want the network to do, it changes the network’s weights so that it 
can produce desired output for a particular input on finishing the training.  
Back Propagation networks are ideal for simple Pattern Recognition and Mapping Tasks . 
Bayesian Networks (BN)


key: chroma:document
string_value:
Bayesian Networks (BN) 
These are the graphi cal structures used to represent the probabilistic relationship among a 
set of random variables. Bayesian networks are also called Belief Networks or Bayes Nets. 
BNs reason about uncertain domain. 
In these networks, each node represents a random variable  with specific propositions . For 
example, in a medical diagnosis domain, the node Cancer represents the proposition that a 
patient has cancer.


key: chroma:document
string_value:
patient has cancer.  
The edges connecting the nodes represent probabilistic dependencies among those random 
variables. If out of two nodes, one is affecting the other then they must be directly connected 
in the directions of the effect. The strength of the relationship between variables is quantified 
by the probability associated with each node. 
There is an only constraint on the arcs in a BN that you cannot return to a node simply by


key: chroma:document
string_value:
following directed arcs. Hence the BNs are called Directed Acyclic Graphs (DAGs). 
BNs are capable of handling multivalued variables simultaneously. The BN variables are 
composed of two dimensions:  
1. Range of prepositions 
2. Probability assigned to each of the prepositions. 
Consider a finite set X = {X1, X2, …,Xn} of discrete random variables, where each variable  Xi 
may take values from a finite set, denoted by  Val(Xi). If there is a directed link from


key: chroma:document
string_value:
variable Xi to variable, Xj, then variable  Xi will be a parent of variable  Xj showing direct 
dependencies between the variables.  
The structure of BN is ideal for combining prior knowledge and observed data. BN can be used 
to learn the causal relationships and underst and various problem domains and to predict 
future events, even in case of missing data. 
Building a Bayesian Network 
A knowledge engineer can build a Bayesian network. There are a number of steps th e


key: chroma:document
string_value:
knowledge engineer needs to take while building it.  Artificial Intelligence  
  57 
Example problem: Lung cancer. A patient has been suffering from breathlessness. He visits 
the doctor, suspecting he has lung cancer. The doctor knows that barring lung cancer, there 
are various other possible diseases the patient might have such as tuberculosis and bronchitis.  
Gather Relevant Information of Problem 
 Is the patient a smoker? If yes, then high chances of cancer and bronchitis.


key: chroma:document
string_value:
 Is the patient exposed to air pollution? If yes, what sort of air pollution?  
 Take an X-Ray positive X-ray would indicate either TB or lung cancer. 
Identify Interesting Variables 
The knowledge engineer tries to answer the questions:  
 Which nodes to represent?  
 What values can they take? In which state can they be?  
For now let us consider nodes, with only discrete values. The variable must take on exactly 
one of these values at a time.  
Common types of discrete nodes are:


key: chroma:document
string_value:
Common types of discrete nodes are:  
• Boolean nodes: They represent propositions, taking binary values TRUE (T) and FALSE 
(F).  
• Ordered values: A node Pollution might represent and take values from {low, medium, 
high} describing degree of a patient’s exposure to pollution.  
• Integral values: A node called Age might represent patient’s age with possible values 
from 1 to 120. Even at this early stage, modeling choices are being made.


key: chroma:document
string_value:
Possible nodes and values for the lung cancer example: 
Node Name Type Value 
 
Pollution Binary {LOW, HIGH, MEDIUM} 
Smoker Boolean {TRUE, FASLE} 
Lung-Cancer Boolean {TRUE, FASLE} 
X-Ray Binary {Positive, Negative} 
 
Create Arcs between Nodes 
Topology of the network should capture qualitative relationships between variables.  
For example, what causes a pa tient to have lung cancer? - Pollution and smoking. Then add 
arcs from node Pollution and node Smoker to node Lung-Cancer.


key: chroma:document
string_value:
Similarly if patient has lung cancer, then X-ray result will be positive . Then add arcs from 
Lung-Cancer to X-Ray.     
 Artificial Intelligence  
  58 
 
Specify Topology 
Conventionally, BNs are laid out so that the arcs point from top to bottom. The set of parent 
nodes of a node X is given by Parents(X). 
The Lung-Cancer node has two parents  (reasons or causes) :  Pollution and Smoker, while 
node Smoker is an ancestor of node X-Ray. Similarly, X-Ray is a child (consequence or


key: chroma:document
string_value:
effects) of node Lung-Cancer and successor of nodes Smoker and Pollution.  
Conditional Probabilities  
Now quantify the relation ships between connected nodes: this is done by specifying a 
conditional probability distribution for each node. As only discrete variables are considered 
here, this takes the form of a Conditional Probability Table (CPT).  
First, for each node we need to look at all the possible combinations of values of those parent


key: chroma:document
string_value:
nodes. Each such combination is called an instantiation of the parent set. For each distinct 
instantiation of parent node values, we need to specify the probability that the child will take.  
For ex ample, the Lung-Cancer node’s parents are Pollution and Smoking. They take the 
possible values = { (H,T), ( H,F), (L,T), (L,F)}. The CPT specifies the probability of cancer for 
each of these cases as <0.05, 0.02, 0.03, 0.001> respectively.


key: chroma:document
string_value:
Each node will have conditional probability associated as follows: 
 Artificial Intelligence  
  59 
 
Applications of Neural Networks 
They can perform tasks that are easy for a human but difficult for a machine: 
 Aerospace: Autopilot aircrafts, aircraft fault detection.  
 Automotive: Automobile guidance systems. 
 Military: Weapon steering, target tracking, object discrimination, facial recognition, 
signal/image identification.


key: chroma:document
string_value:
signal/image identification. 
 Electronics: Code sequence prediction, IC chip layout, chip failure analy sis, machine 
vision, voice synthesis. 
 Financial: Real estate appraisal, loan advisor, mortgage screening, corporate bond 
rating, portfolio trading program, corporate financial analysis, currency value 
prediction, document readers, credit application evaluators. 
 Industrial: Manufacturing process control, product design and analysis, quality


key: chroma:document
string_value:
inspection systems, welding quality analy sis, paper quality predict ion,  chemical 
product design analy sis, dynamic modeling of chemical process systems, machine 
maintenance analysis, project bidding, planning, and management.  
 Artificial Intelligence  
  60 
 Medical: Cancer cell analysis, EEG and ECG analysis, prosthe tic design, transplant 
time optimizer. 
 Speech: Speech recognition, speech classification, text to speech conversion.


key: chroma:document
string_value:
 Telecommunications: Image and data compression, automated information 
services, real-time spoken language translation. 
 Transportation: Truck brake diagnosis, vehicle scheduling, routing systems.  
 Software: Pattern Recognition in facial recognition, optical character recognition, etc. 
 Time Series Predict ion: ANNs are used to make predictions on stocks and natural 
calamities. 
 Signal Processing: Neural networks can be trained to process an audio signal and


key: chroma:document
string_value:
filter it appropriately in the hearing aids. 
 Control: ANNs are often used to make steering decisions of physical vehicles. 
 Anomaly Detection: As ANNs are expert at recognizing patterns, they can also be 
trained to generate an output when something unusual occurs that misfits the pattern.   Artificial Intelligence  
  61 
AI is developing with such an incredible speed, sometimes  it seems magical. There is an


key: chroma:document
string_value:
opinion among researchers and developers that AI could grow so immensely strong that it 
would be difficult for humans to control.  
Humans developed AI systems by introducing into them every possible intelligence they could, 
for which the humans themselves now seem threatened.  
Threat to Privacy 
An AI program that recognizes speech and understands natural language is theoretically 
capable of understanding each conversation on e-mails and telephones. 
Threat to Human Dignity


key: chroma:document
string_value:
Threat to Human Dignity 
AI systems have already started replacing the human beings  in few industries. It should not 
replace people in the sectors where they are holding dignified positions  which are pertaining 
to ethics such as nursing, surgeon, judge, police officer, etc.  
Threat to Safety 
The self-improving AI systems can become so mighty than humans that could be very difficult 
to stop from achieving their goals, which may lead to unintended consequences.


key: chroma:document
string_value:
11. AI Issues  Artificial Intelligence  
  62 
Here is the list of frequently used terms in the domain of AI: 
 
Term Meaning 
Agent Agents are systems or software programs capable of autonomous, 
purposeful and reasoning directed towards one or more goals.  They 
are also called assistants, brokers, bots, droids, intelligent agents, and 
software agents. 
Autonomous Robot Robot free from external control or influence and able to control itself 
independently.


key: chroma:document
string_value:
independently. 
Backward Chaining Strategy of working backward for Reason/Cause of a problem. 
Blackboard It is the memory inside computer, which is used for communic ation 
between the cooperating expert systems. 
Environment It is the part of real or computational world inhabited by the agent. 
Forward Chaining Strategy of working forward for conclusion/solution of a problem. 
Heuristics It is the knowledge based on Tr ial-and-error, evaluations, and 
experimentation. 
Knowledge


key: chroma:document
string_value:
experimentation. 
Knowledge 
Engineering Acquiring knowledge from human experts and other resources. 
Percepts It is the format in which the agent obtains information about the 
environment. 
Pruning Overriding unnecessary and irrelevant considerations in AI systems. 
Rule It is a format of representing knowledge base in Expert System. It is in 
the form of IF-THEN-ELSE. 
Shell A shell is a software that helps in designing inference engine,


key: chroma:document
string_value:
knowledge base, and user interface of an expert system. 
Task It is the goal the agent is tries to accomplish. 
Turing Test A test developed by Allan Turing to test the intelligence of a machine 
as compared to human intelligence.   
  
 
 
 
 
 
  
12. AI Terminology


key: chroma:document
string_value:
Good morning. Please take a seat. Why are you applying for this job? I'm looking for a job that fits my qualifications and a company I can grow with. Why should I hire you? What are your strengths? I work well with other people and I'm very ambitious. I'm also always looking for opportunities to learn and grow. Do you work well under pressure? Yes, I'm able to stay calm and focused. Where do you see yourself in the next five years? By then I would like to have improved my skills and become more


key: chroma:document
string_value:
like to have improved my skills and become more independent in what I do. Do you have any questions for me, Mr. Acker? No, I think I have a good understanding of the job and I'm excited at the prospect of working within your team. Thanks for coming in today. We will call you soon with our decision. Thanks for considering me. Have a nice day.


key: chroma:document
string_value:
Welcome to the course on English grammar for Office Communication. Communication is the heart and soul of the human experience. The process of communication mainly includes speaking, listening and writing. It is a natural phenomenon that we start speaking what everybody speaks around us. We gradually develop a better sense of understanding with the passage of time. A good knowledge of grammar gives us a competitive edge in the business situations. Grammar is a study of words and the way words


key: chroma:document
string_value:
Grammar is a study of words and the way words work together. There are eight parts of speech they are noun, pronoun, verb, adverb, interjection, conjunction, preposition and adjective. This unit will enable you to identify a noun in the sentence, point out a pronoun and outline an adjective. Let us start this unit with the basic part of speech. noun what is a noun? Why is it used? What are its classifications? Look around you. What do you see? A computer, the living room, your dad, everything


key: chroma:document
string_value:
A computer, the living room, your dad, everything that you see you can name is a noun. There are four kinds of nouns. Common nouns, proper nouns, abstract nouns and collective noun. Click on each of these nouns to know more. Here is a list of some proper and their corresponding common nouns. Let us now try to identify the nouns in a sentence. This is my dog. It lives in my house. We live in London. Here, dog and house refers to a thing and London refers to the place. Hence, these are nouns.


key: chroma:document
string_value:
refers to the place. Hence, these are nouns. Joseph Priestley discovered oxygen. Here, there are two nouns. Joseph Priestley and oxygen.


key: chroma:document
string_value:
White Paper
Introduction to Cloud Computing Introduction to Cloud Computing
2
White Paper
Executive Summary
A common understanding of “cloud computing” is continuously evolving, and the terminology and concepts used to define it often 
need clarifying. Press coverage can be vague or may not fully capture the extent of what cloud computing entails or represents, 
sometimes reporting how companies are making their solutions available in the “cloud” or how “cloud computing” is the way


key: chroma:document
string_value:
forward, but not examining the characteristics, models, and services involved in understanding what cloud computing is and what 
it can become.
This white paper introduces internet-based cloud computing, exploring the characteristics, service models, and deployment models 
in use today, as well as the benefits and challenges associated with cloud computing. Also discussed are the communications


key: chroma:document
string_value:
services in the cloud (including ways to access the cloud, such as web APIs and media control interfaces) and the importance of 
scalability and flexibility in a cloud-based environment. 
Also noted for businesses desiring to start using communication services, are the interface choices available, including Web 2.0 
APIs, media control interfaces, Java interfaces, and XML based interfaces, catering to a wide range of application and service 
creation developers. Introduction to Cloud Computing


key: chroma:document
string_value:
3
White Paper
Table of Contents
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4
Cloud Computing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4


key: chroma:document
string_value:
Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4
Service Models  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5
Deployment Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5


key: chroma:document
string_value:
Benefits  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6
Challenges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6
Communications in the Cloud . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6


key: chroma:document
string_value:
Using the Communications Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7
Accessing through Web APIs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7
Media Server Control Interfaces  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7


key: chroma:document
string_value:
Communications Scalability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8
Getting Started with Communications Services  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8 Introduction to Cloud Computing
4
White Paper
Introduction


key: chroma:document
string_value:
4
White Paper
Introduction
This white paper is an introduction to the terms, characteristics, and services associated with internet-based computing, commonly referred to as 
cloud computing  . Characteristics, such as infrastructure, provisioning, network access, and managed metering are presented  . 
The primary business service models being deployed (such as software, platform, and infrastructure as a service) and common deployment


key: chroma:document
string_value:
models employed by service providers and users to use and maintain the cloud services (such as the private, public, community, and hybrid 
clouds) are discussed  . 
Also introduced are the benefits and challenges associated with cloud computing, and for those seeking to use communications services in the 
cloud, briefly presented are different ways of determining the interfaces needed to use these communications services  .
Cloud Computing


key: chroma:document
string_value:
Cloud Computing
The term “cloud”, as used in this white paper, appears to have its origins in network diagrams that represented the internet, or various parts of 
it, as schematic clouds  . “Cloud computing” was coined for what happens when applications and services are moved into the internet “cloud  .” 
Cloud computing is not something that suddenly appeared overnight; in some form, it may trace back to a time when computer systems remotely


key: chroma:document
string_value:
time-shared computing resources and applications  . More currently though, cloud computing refers to the many different types of services and 
applications being delivered in the internet cloud, and the fact that, in many cases, the devices used to access these services and applications 
do not require any special applications  . 
Many companies are delivering services from the cloud  . Some notable examples include the following:


key: chroma:document
string_value:
•  Google — Has a private cloud that it uses for delivering Google Docs and many other services to its users, including email access, document 
applications, text translations, maps, web analytics, and much more . 
•  Microsoft — Has Microsoft
® Office 365® online service that allows for content and business intelligence tools to be moved into the cloud, and 
Microsoft currently makes its office applications available in a cloud .


key: chroma:document
string_value:
•  Salesforce.com — Runs its application set for its customers in a cloud, and its Force .com and Vmforce .com products provide developers with 
platforms to build customized cloud services .
But, what is cloud computing? The following sections note cloud and cloud computing characteristics, services models, deployment models, 
benefits, and challenges .
Characteristics
Cloud computing has a variety of characteristics, with the main ones being:


key: chroma:document
string_value:
•  Shared Infrastructure — Uses a virtualized software model, enabling the sharing of physical services, storage, and networking capabilities . The 
cloud infrastructure, regardless of deployment model, seeks to make the most of the available infrastructure across a number of users .
•  Dynamic Provisioning — Allows for the provision of services based on current demand requirements . This is done automatically using software


key: chroma:document
string_value:
automation, enabling the expansion and contraction of service capability, as needed . This dynamic scaling needs to be done while maintaining 
high levels of reliability and security .
•  Network Access — Needs to be accessed across the internet from a broad range of devices such as PCs, laptops, and mobile devices, 
using standards-based APIs (for example, ones based on HTTP) . Deployments of services in the cloud include everything from using business


key: chroma:document
string_value:
applications to the latest application on the newest smartphones . 
•  Managed Metering — Uses metering for managing and optimizing the service and to provide reporting and billing information . In this way, 
consumers are billed for services according to how much they have actually used during the billing period . 
In short, cloud computing allows for the sharing and scalable deployment of services, as needed, from almost any location, and for which the


key: chroma:document
string_value:
customer can be billed based on actual usage  .  Introduction to Cloud Computing
5
White Paper
Service Models 
Once a cloud is established, how its cloud computing services are deployed in terms of business models can differ depending on requirements  . 
The primary service models being deployed (see Figure 1) are commonly known as:
•  Software as a Service (SaaS) — Consumers purchase the ability to access and use an application or service that is hosted in the cloud . A


key: chroma:document
string_value:
benchmark example of this is Salesforce .com, as discussed previously, where necessary information for the interaction between the consumer and 
the service is hosted as part of the service in the cloud . 
Also, Microsoft has made a significant investment in this area, and as part of the cloud computing option for Microsoft
® Office 365, its Office suite 
is available as a subscription through its cloud-based Online Services  .


key: chroma:document
string_value:
•  Platform as a Service (PaaS) — Consumers purchase access to the platforms, enabling them to deploy their own software and applications in 
the cloud . The operating systems and network access are not managed by the consumer, and there might be constraints as to which applications 
can be deployed . Examples include Amazon Web Services (AWS), Rackspace and Microsoft Azure .


key: chroma:document
string_value:
•  Infrastructure as a Service (IaaS) — Consumers control and manage the systems in terms of the operating systems, applications, storage, and 
network connectivity, but do not themselves control the cloud infrastructure .
Also known are the various subsets of these models that may be related to a particular industry or market  . Communications as a Service (CaaS) is


key: chroma:document
string_value:
one such subset model used to describe hosted IP telephony services  . Along with the move to CaaS is a shift to more IP-centric communications 
and more SIP trunking deployments  . With IP and SIP in place, it can be as easy to have the PBX in the cloud as it is to have it on the premise  . In 
this context, CaaS could be seen as a subset of SaaS  .
Figure 1. Service Model Types
Deployment Models


key: chroma:document
string_value:
Figure 1. Service Model Types
Deployment Models
Deploying cloud computing can differ depending on requirements, and the following four deployment models have been identified, each with 
specific characteristics that support the needs of the services and users of the clouds in particular ways (see Figure 2)  .
•  Private Cloud — The cloud infrastructure has been deployed, and is maintained and operated for a specific organization . The operation may be


key: chroma:document
string_value:
in-house or with a third party on the premises . 
•  Community Cloud — The cloud infrastructure is shared among a number of organizations with similar interests and requirements . This may help 
limit the capital expenditure costs for its establishment as the costs are shared among the organizations . The operation may be in-house or with 
a third party on the premises .


key: chroma:document
string_value:
a third party on the premises . 
•  Public Cloud — The cloud infrastructure is available to the public on a commercial basis by a cloud service provider . This enables a consumer to 
develop and deploy a service in the cloud with very little financial outlay compared to the capital expenditure requirements normally associated 
with other deployment options .


key: chroma:document
string_value:
with other deployment options . 
•  Hybrid Cloud — The cloud infrastructure consists of a number of clouds of any type, but the clouds have the ability through their interfaces to 
allow data and/or applications to be moved from one cloud to another . This can be a combination of private and public clouds that support the 
requirement to retain some data in an organization, and also the need to offer services in the cloud .


key: chroma:document
string_value:
Enduser application is delivered as a service. Platform and infrastructure is abstracted, and 
can deployed and managed with less effort.
Physical infrastructure is abstracted to provide computing, storage, and networking as a 
service, avoiding the expense and need for dedicated systems.
Software as a Service (SaaS)
Application platform onto which custom applications and services can be deployed. Can be 
built and deployed more inexpensively, although services need to be supported and managed.


key: chroma:document
string_value:
Platform as a Service (PaaS)
Infrastructure as a Service (IaaS) Introduction to Cloud Computing
6
White Paper
Figure 2. Public, Private, and Hybrid Cloud Deployment Example
Benefits
The following are some of the possible benefits for those who offer cloud computing-based services and applications: 
•  Cost Savings — Companies can reduce their capital expenditures and use operational expenditures for increasing their computing capabilities .


key: chroma:document
string_value:
This is a lower barrier to entry and also requires fewer in-house IT resources to provide system support .
•  Scalability/Flexibility — Companies can start with a small deployment and grow to a large deployment fairly rapidly, and then scale back if 
necessary . Also, the flexibility of cloud computing allows companies to use extra resources at peak times, enabling them to satisfy consumer 
demands .


key: chroma:document
string_value:
demands . 
•  Reliability — Services using multiple redundant sites can support business continuity and disaster recovery .
•  Maintenance — Cloud service providers do the system maintenance, and access is through APIs that do not require application installations onto 
PCs, thus further reducing maintenance requirements .
•  Mobile Accessible — Mobile workers have increased productivity due to systems accessible in an infrastructure available from anywhere .
Challenges


key: chroma:document
string_value:
Challenges
The following are some of the notable challenges associated with cloud computing, and although some of these may cause a slowdown when 
delivering more services in the cloud, most also can provide opportunities, if resolved with due care and attention in the planning stages  .
•  Security and Privacy — Perhaps two of the more “hot button” issues surrounding cloud computing relate to storing and securing data, and


key: chroma:document
string_value:
monitoring the use of the cloud by the service providers . These issues are generally attributed to slowing the deployment of cloud services . These 
challenges can be addressed, for example, by storing the information internal to the organization, but allowing it to be used in the cloud . For 
this to occur, though, the security mechanisms between organization and the cloud need to be robust and a Hybrid cloud could support such a 
deployment .


key: chroma:document
string_value:
deployment . 
•  Lack of Standards — Clouds have documented interfaces; however, no standards are associated with these, and thus it is unlikely that most 
clouds will be interoperable . The Open Grid Forum is developing an Open Cloud Computing Interface to resolve this issue and the Open Cloud 
Consortium is working on cloud computing standards and practices . The findings of these groups will need to mature, but it is not known whether


key: chroma:document
string_value:
they will address the needs of the people deploying the services and the specific interfaces these services need . However, keeping up to date on 
the latest standards as they evolve will allow them to be leveraged, if applicable . 
•  Continuously Evolving — User requirements are continuously evolving, as are the requirements for interfaces, networking, and storage . This 
means that a “cloud,” especially a public one, does not remain static and is also continuously evolving .


key: chroma:document
string_value:
•  Compliance Concerns — The Sarbanes-Oxley Act (SOX) in the US and Data Protection directives in the EU are just two among many compliance 
issues affecting cloud computing, based on the type of data and application for which the cloud is being used . The EU has a legislative backing 
for data protection across all member states, but in the US data protection is different and can vary from state to state . As with security and privacy


key: chroma:document
string_value:
mentioned previously, these typically result in Hybrid cloud deployment with one cloud storing the data internal to the organization . 
Communications in the Cloud
For service developers, making services available in the cloud depends on the type of service and the device(s) being used to access it . The process 
may be as simple as a user clicking on the required web page, or could involve an application using an API accessing the services in the cloud  . 
Enterprise
 Public internet


key: chroma:document
string_value:
Enterprise
 Public internet
Private cloud in 
enterprise
Enterprise 1
Clous services
Public cloud
Enterprise 2
Hybrid Cloud - 
Combining Public Internet
a Private and Public Cloud Introduction to Cloud Computing
7
White Paper
Telcos are starting to use clouds to release their own services and those developed by others, but using Telco infrastructure and data  . The 
expectation is that the Telco’s communications infrastructure provides a revenue generating opportunity  .


key: chroma:document
string_value:
Using the Communications Services
When in the cloud, communications services can extend their capabilities, or stand alone as service offerings, or provide new interactivity 
capabilities to current services  .
Cloud-based communications services enable businesses to embed communications capabilities into business applications, such as Enterprise 
Resource Planning (ERP) and Customer Relationship Management (CRM) systems  . For “on the move” business people, these can be accessed


key: chroma:document
string_value:
through a smartphone, supporting increased productivity while away from the office  . 
These services are over and above the support of service deployments of VoIP systems, collaboration systems, and conferencing systems for 
both voice and video  . They can be accessed from any location and linked into current services to extend their capabilities, as well as stand alone 
as service offerings  .


key: chroma:document
string_value:
as service offerings  .
In terms of social networking, using cloud-based communications provides click-to-call capabilities from social networking sites, access to Instant 
Messaging systems and video communications, broadening the interlinking of people within the social circle  . 
Accessing through Web APIs
Accessing communications capabilities in a cloud-based environment is achieved through APIs, primarily Web 2  .0 RESTful APIs, allowing


key: chroma:document
string_value:
application development outside the cloud to take advantage of the communication infrastructure within it (see Figure 3)  .
Figure 3. Web 2.0 Interfaces to the Cloud
These APIs open up a range of communications possibilities for cloud-based services, only limited by the media and signaling capabilities within 
the cloud . Today’s media services allow for communications and management of voice and video across a complex range of codecs and transport


key: chroma:document
string_value:
types  . By using the Web APIs, these complexities can be simplified and the media can be delivered to the remote device more easily  . APIs also 
enable communication of other services, providing new opportunities and helping to drive Average Revenue per User (ARPU) and attachment 
rates, especially for Telcos  . 
Media Server Control Interfaces
When building communications capabilities into the “core of the cloud,” where they will be accessed by another service, the Web 2  .0 APIs


key: chroma:document
string_value:
can be used, as well as a combination of SIP or VoiceXML and the standard media controlling APIs such as MSML, MSCML, and JSR309  . The 
combinations provide different capability sets, but with MediaCTRL being developed in the Internet Engineering Task Force (IETF), it is expected 
that MediaCTRL will supersede MSML and MSCML and have an upsurge in availability and more developments after it is ratified  . JSR309 is a


key: chroma:document
string_value:
notable choice for those seeking Java development, as it provides the Java interface to media control  .
Figure 4 is an example of accessing services in the cloud through Web 2  .0 and media control interface APIs  .
Cloud-based service
Media and signaling 
capabilities
Web 2.0 
interface
 Introduction to Cloud Computing
8
White Paper
Figure 4. Accessing the Communications Capabilities from Within the Cloud


key: chroma:document
string_value:
Whether businesses are deploying communications services for access from outside of or within the cloud, the environment is one that supports 
the speedy development and rollout of these capabilities  .
Communications Scalability
To deliver on the scalability requirements for cloud-based deployments, the communications software should be capable of running in virtual


key: chroma:document
string_value:
environments  . This allows for easily increasing and decreasing session densities based on the needs at the time, while keeping the physical 
resource requirement on servers to a minimum  .
Getting Started with Communications Services
Businesses desiring to use the communications capabilities of cloud-based services will stand to benefit by determining the right interfaces  .


key: chroma:document
string_value:
Dialogic supports a broad range of interfaces, including RESTful APIs, media control interfaces, Java interfaces, and XML-based interfaces, 
catering to a wide range of application and service creation developers  . These interfaces, available over media and signaling capabilities, support 
the scalability needed in a cloud-based environment while still being easy to deploy and administer  .
Cloud-based service
Media and 
signaling
Application 
server
Web 2.0 
interface


key: chroma:document
string_value:
signaling
Application 
server
Web 2.0 
interface
Application server controls media server 
through media control APIs or Web 2.0 www.dialogic.com
For a list of Dialogic locations and offices, please visit: https://www  .dialogic  .com/contact  .
INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH PRODUCTS OF DIALOGIC CORPORATION AND ITS AFFILIATES OR SUBSIDIARIES (“DIALOGIC”)  . NO LICENSE,


key: chroma:document
string_value:
EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS DOCUMENT  . EXCEPT AS PROVIDED IN A SIGNED AGREEMENT 
BETWEEN YOU AND DIALOGIC, DIALOGIC ASSUMES NO LIABILITY WHATSOEVER, AND DIALOGIC DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO SALE AND/OR USE 
OF DIALOGIC PRODUCTS INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY INTELLECTUAL 
PROPERTY RIGHT OF A THIRD PARTY  .


key: chroma:document
string_value:
PROPERTY RIGHT OF A THIRD PARTY  .
Dialogic products are not intended for use in certain safety-affecting situations  .  Please see http://www  .dialogic  .com/company/terms-of-use  .aspx for more details  .
Dialogic may make changes to specifications, product descriptions, and plans at any time, without notice  .


key: chroma:document
string_value:
Dialogic is a registered trademark of Dialogic Corporation and its affiliates or subsidiaries  . Dialogic’s trademarks may be used publicly only with permission from Dialogic  . Such permission 
may only be granted by Dialogic’s legal department at 3300 Boulevard de la Côte-Vertu, Suite 112, Montreal, Quebec, Canada H4R 1P8  . Any authorized use of Dialogic’s trademarks will be


key: chroma:document
string_value:
subject to full respect of the trademark guidelines published by Dialogic from time to time and any use of Dialogic’s trademarks requires proper acknowledgement  .
The names of actual companies and products mentioned herein are the trademarks of their respective owners  . Dialogic encourages all users of its products to procure all necessary 
intellectual property licenses required to implement their concepts or applications, which licenses may vary from country to country  .


key: chroma:document
string_value:
Any use case(s) shown and/or described herein represent one or more examples of the various ways, scenarios or environments in which Dialogic
® products can be used  .  Such use case(s) are 
non-limiting and do not represent recommendations of Dialogic as to whether or how to use Dialogic products  . 
Copyright © 2017 Dialogic Corporation  .  All rights reserved  . 10/17    12023-02


key: chroma:document
string_value:
This is Sarah Burowski. She's a photographer in New York. She loves her work and her day is always busy. This is a day in her life. Sarah gets up at 8 o'clock in the morning. She brushes her teeth and has breakfast. She always makes coffee. At 8.30, Sarah gets her camera, leaves home and goes to work. New York City is always busy in the morning. Sarah never drives. She usually travels by train. Sometimes she takes photographs on the journey. Sarah works in West Brooklyn. She works for a


key: chroma:document
string_value:
Sarah works in West Brooklyn. She works for a magazine. Sometimes she works in the office. But she often works outside. At 1 o'clock in the afternoon, Sarah has lunch. She often meets a friend and goes to her favorite cafe. Sarah usually finishes work at 6. And she gets home at 6.30. Sarah has a really nice apartment in East Brooklyn. But it's a little bit small. She sometimes has dinner at a restaurant. But she usually eats at home. She eats dinner at 7.30. In the evening, she looks at her


key: chroma:document
string_value:
dinner at 7.30. In the evening, she looks at her photographs on her computer and serves the internet. She sometimes watches TV. Sarah never goes to bed early. She sometimes stays up until 2 in the morning.


key: chroma:document
string_value:
[Type here] 
 
Types of Test Cases: 
 
Unit Testing 
Unit testing verifies a single function or method in isolation to ensure it works correctly. 
  Example: Testing one function’s logic without database, API, or UI. 
 
Integration Testing 
Integration testing verifies multiple functions or modules working together, where one function may call another 
function or interact with external components like a database.


key: chroma:document
string_value:
Example: Testing a function that internally calls another function and processes combined results. 
 
Functional Testing 
Functional testing verifies the complete feature or page behavior, ensuring the system performs as expected from 
the user’s perspective. 
  Example: Testing a full page or API endpoint that processes user input and returns output. 
 
 
SpringBoot Test Cases: 
 
References (BEST LEARNING LINKS) 
     Official Docs 
   Spring Boot Testing


key: chroma:document
string_value:
Official Docs 
   Spring Boot Testing 
https://docs.spring.io/spring-boot/docs/current/reference/html/features.html#features.testing 
     Baeldung (Highly Recommended) 
   Controller Testing 
https://www.baeldung.com/spring-boot-testing 
   MockMvc 
https://www.baeldung.com/spring-mvc-test-examples 
          YouTube (Easy) 
• Search: “Spring Boot MockMvc tutorial” 
• Channel: Java Brains / Amigoscode 
Recommended Approach for LMS Project  [Type here] 
 
Layer Testing Tool Notes


key: chroma:document
string_value:
Layer Testing Tool Notes 
Controller / API MockMvc Fast, mock dependencies 
Service JUnit + Mockito Test business logic without HTTP 
Repository @DataJpaTest Test DB queries with H2 
Full App Flow @SpringBootTest End-to-end integration 
 
Unit Test Cases 
 
╔════════════════════════════════════════════════════════════
══════════════════╗ 
║                    CONTROLLER TESTING QUICK REFERENCE                        ║ 
╚════════════════════════════════════════════════════════════


key: chroma:document
string_value:
══════════════════╝ 
 
┌──────────────────────────────────────────────────────────────────────────────┐ 
│ 1. TEST CLASS SETUP                                                          │ 
└──────────────────────────────────────────────────────────────────────────────┘ 
 
@ExtendWith(MockitoExtension.class)  ← Add this to every test class 
class YourControllerTest { 
     
    @Mock                                ← Fake version of dependency 
    private YourService service;


key: chroma:document
string_value:
private YourService service; 
     
    @InjectMocks                         ← Real controller with fake dependencies 
    private YourController controller; 
     
    @Test                                ← This marks a test method 
    void testSomething() { } 
} 
 
┌──────────────────────────────────────────────────────────────────────────────┐ 
│ 2. THE AAA PATTERN (Use in Every Test)                                      │  [Type here]


key: chroma:document
string_value:
└──────────────────────────────────────────────────────────────────────────────┘ 
 
@Test 
void testMethod_Success() { 
     
    // ===== ARRANGE ===== (Set up) 
    when(service.getData()).thenReturn(data); 
     
    // ===== ACT ===== (Execute) 
    ResponseEntity<?> response = controller.method(); 
     
    // ===== ASSERT ===== (Check) 
    assertEquals(HttpStatus.OK, response.getStatusCode()); 
     
    // ===== VERIFY ===== (Confirm method calls)


key: chroma:document
string_value:
// ===== VERIFY ===== (Confirm method calls) 
    verify(service, times(1)).getData(); 
} 
 
┌──────────────────────────────────────────────────────────────────────────────┐ 
│ 3. MOCKITO PATTERNS                                                          │ 
└──────────────────────────────────────────────────────────────────────────────┘ 
 
┌─────────────────────────────┬──────────────────────────────────────────────┐


key: chroma:document
string_value:
│ Pattern                     │ When to Use                                  │ 
├─────────────────────────────┼──────────────────────────────────────────────┤ 
│ when().thenReturn()         │ Method returns a value                       │ 
│ when().thenThrow()          │ Method throws exception                      │ 
│ doNothing().when()          │ Method returns void                          │ 
│ any()                       │ Any argument of any type                     │


key: chroma:document
string_value:
│ anyLong()                   │ Any Long argument                            │ 
│ anyString()                 │ Any String argument                          │  [Type here] 
 
│ eq(value)                   │ Specific value (with any())                  │ 
└─────────────────────────────┴──────────────────────────────────────────────┘ 
 
Examples: 
┌──────────────────────────────────────────────────────────────────────────────┐


key: chroma:document
string_value:
│ when(service.findById(1L)).thenReturn(user);                                 │ 
│ when(service.findById(any())).thenReturn(user);                              │ 
│ when(service.save(any())).thenThrow(new RuntimeException());                 │ 
│ doNothing().when(service).delete(1L);                                        │ 
│ when(service.update(eq(1L), any())).thenReturn(updated);                     │ 
└──────────────────────────────────────────────────────────────────────────────┘


key: chroma:document
string_value:
┌──────────────────────────────────────────────────────────────────────────────┐ 
│ 4. COMMON ASSERTIONS                                                         │ 
└──────────────────────────────────────────────────────────────────────────────┘ 
 
┌─────────────────────────────────────┬────────────────────────────────────────┐ 
│ Assertion                           │ What it Checks                         │ 
├─────────────────────────────────────┼────────────────────────────────────────┤


key: chroma:document
string_value:
│ assertEquals(expected, actual)      │ Two values are equal                   │ 
│ assertNotNull(object)               │ Object is not null                     │ 
│ assertTrue(condition)               │ Condition is true                      │ 
│ assertFalse(condition)              │ Condition is false                     │ 
│ assertThrows(Exception.class, ...)  │ Code throws exception                  │ 
└─────────────────────────────────────┴────────────────────────────────────────┘


key: chroma:document
string_value:
Examples: 
┌──────────────────────────────────────────────────────────────────────────────┐ 
│ assertEquals(HttpStatus.OK, response.getStatusCode());                       │ 
│ assertNotNull(response.getBody());                                           │ 
│ assertEquals("John", user.getName());                                        │  [Type here] 
 
│ assertTrue(list.isEmpty());                                                  │


key: chroma:document
string_value:
└──────────────────────────────────────────────────────────────────────────────┘ 
 
┌──────────────────────────────────────────────────────────────────────────────┐ 
│ 5. VERIFY METHOD CALLS                                                       │ 
└──────────────────────────────────────────────────────────────────────────────┘ 
 
┌──────────────────────────────────────────────────────────────────────────────┐ 
│ verify(service, times(1)).method();     ← Called exactly once                │


key: chroma:document
string_value:
│ verify(service, times(2)).method();     ← Called exactly twice               │ 
│ verify(service, never()).method();      ← Never called                       │ 
│ verify(service, atLeast(1)).method();   ← Called at least once               │ 
└──────────────────────────────────────────────────────────────────────────────┘ 
 
┌──────────────────────────────────────────────────────────────────────────────┐ 
│ 6. TEST SCENARIOS (Write These for Every Method)                            │


key: chroma:document
string_value:
└──────────────────────────────────────────────────────────────────────────────┘ 
 
For a GET method: 
├──    testGetMethod_Success          (Returns 200 OK with data) 
├──    testGetMethod_NotFound         (Returns 404 when not found) 
├──    testGetMethod_Error            (Returns 500 on exception) 
└──    testGetMethod_EmptyData        (Returns 200 with empty list) 
 
For a POST method: 
├──    testPostMethod_Success         (Returns 201 CREATED)


key: chroma:document
string_value:
├──    testPostMethod_BadRequest      (Returns 400 for invalid data) 
├──    testPostMethod_Error           (Returns 500 on exception) 
└──    testPostMethod_Duplicate       (Returns 409 if already exists) 
 
For a DELETE method:  [Type here] 
 
├──    testDeleteMethod_Success       (Returns 200 OK) 
├──    testDeleteMethod_NotFound      (Returns 404) 
└──    testDeleteMethod_Error         (Returns 500 on exception)


key: chroma:document
string_value:
┌──────────────────────────────────────────────────────────────────────────────┐ 
│ 7. RUNNING TESTS                                                             │ 
└──────────────────────────────────────────────────────────────────────────────┘ 
 
Command Line: 
┌──────────────────────────────────────────────────────────────────────────────┐ 
│ mvn test                              ← Run all tests                        │


key: chroma:document
string_value:
│ mvn test -Dtest=YourControllerTest    ← Run specific test class             │ 
│ mvn test -Dtest=YourControllerTest#testMethod  ← Run specific test method   │ 
│ mvn clean test jacoco:report          ← Run with coverage report            │ 
└──────────────────────────────────────────────────────────────────────────────┘ 
 
IDE: 
┌──────────────────────────────────────────────────────────────────────────────┐ 
│ Right-click test file → Run 'YourControllerTest'                            │


key: chroma:document
string_value:
│ Right-click test method → Run 'testMethod'                                  │ 
│ Click green play button next to test                                        │ 
└──────────────────────────────────────────────────────────────────────────────┘ 
 
┌──────────────────────────────────────────────────────────────────────────────┐ 
│ 8. TEST NAMING CONVENTION                                                    │ 
└──────────────────────────────────────────────────────────────────────────────┘


key: chroma:document
string_value:
Format: test[MethodName]_[Scenario] 
 
Examples: 
├── testGetUser_Success  [Type here] 
 
├── testGetUser_NotFound 
├── testGetUser_Error 
├── testCreateUser_Success 
├── testCreateUser_ValidationError 
├── testDeleteUser_Success 
└── testDeleteUser_NotFound 
 
┌──────────────────────────────────────────────────────────────────────────────┐ 
│ 9. COMPLETE EXAMPLE                                                          │


key: chroma:document
string_value:
└──────────────────────────────────────────────────────────────────────────────┘ 
 
Controller: 
┌──────────────────────────────────────────────────────────────────────────────┐ 
│ @GetMapping("/user/{id}")                                                    │ 
│ public ResponseEntity<User> getUser(@PathVariable Long id) {                │ 
│     User user = userService.findById(id);                                   │


key: chroma:document
string_value:
│     return ResponseEntity.ok(user);                                         │ 
│ }                                                                            │ 
└──────────────────────────────────────────────────────────────────────────────┘ 
 
Test: 
┌──────────────────────────────────────────────────────────────────────────────┐ 
│ @ExtendWith(MockitoExtension.class)                                         │ 
│ class UserControllerTest {                                                  │


key: chroma:document
string_value:
│                                                                              │ 
│     @Mock                                                                    │ 
│     private UserService userService;                                        │ 
│                                                                              │ 
│     @InjectMocks                                                             │ 
│     private UserController userController;                                  │


key: chroma:document
string_value:
│                                                                              │  [Type here] 
 
│     @Test                                                                    │ 
│     void testGetUser_Success() {                                            │ 
│         // ARRANGE                                                           │ 
│         Long userId = 1L;                                                    │


key: chroma:document
string_value:
│         User expectedUser = new User(1L, "John");                           │ 
│         when(userService.findById(userId)).thenReturn(expectedUser);        │ 
│                                                                              │ 
│         // ACT                                                               │ 
│         ResponseEntity<User> response = userController.getUser(userId);     │ 
│                                                                              │


key: chroma:document
string_value:
│         // ASSERT                                                            │ 
│         assertEquals(HttpStatus.OK, response.getStatusCode());              │ 
│         assertEquals("John", response.getBody().getName());                 │ 
│                                                                              │ 
│         // VERIFY                                                            │ 
│         verify(userService, times(1)).findById(userId);                     │


key: chroma:document
string_value:
│     }                                                                        │ 
│ }                                                                            │ 
└──────────────────────────────────────────────────────────────────────────────┘ 
 
┌──────────────────────────────────────────────────────────────────────────────┐ 
│ 10. TROUBLESHOOTING                                                          │ 
└──────────────────────────────────────────────────────────────────────────────┘


key: chroma:document
string_value:
Problem: Mocks don't work 
└── Solution: Add @ExtendWith(MockitoExtension.class) 
 
Problem: NullPointerException in test 
└── Solution: Did you mock the return value? when(service.method()).thenReturn(...) 
 
Problem: Test fails with "wanted but not invoked"  [Type here] 
 
└── Solution: Check if method name and parameters match exactly 
 
Problem: Wrong number of invocations 
└── Solution: Check verify() count matches actual method calls 
 
Problem: Can't use eq() and any() together


key: chroma:document
string_value:
Problem: Can't use eq() and any() together 
└── Solution: If you use any() for one parameter, use eq() for specific values 
 
┌──────────────────────────────────────────────────────────────────────────────┐ 
│ 11. CHECKLIST BEFORE SUBMITTING TESTS                                       │ 
└──────────────────────────────────────────────────────────────────────────────┘ 
 
□ Test class has @ExtendWith(MockitoExtension.class) 
□ All dependencies are mocked with @Mock


key: chroma:document
string_value:
□ All dependencies are mocked with @Mock 
□ Controller has @InjectMocks 
□ Success test case written 
□ Error test case written 
□ Edge cases covered 
□ All tests use AAA pattern 
□ Tests have descriptive names 
□ verify() statements added where needed 
□ All tests pass: mvn test 
□ No System.out.println() in tests 
 
┌──────────────────────────────────────────────────────────────────────────────┐ 
│ 12. REMEMBER                                                                 │


key: chroma:document
string_value:
└──────────────────────────────────────────────────────────────────────────────┘ 
 
       One test = One scenario 
          AAA Pattern = Arrange, Act, Assert 
   Mock = Fake object  [Type here] 
 
   Verify = Check method was called 
    Test success AND failure scenarios 
        Start simple, add complexity gradually 
 
Integration Test cases: 
 
File Placement 
1. Test Class 
src/test/java/com/britanica/pbl/controller/ 
└── DomainControllerIntegrationTest.java 
2. Test Configuration


key: chroma:document
string_value:
2. Test Configuration 
src/test/resources/ 
└── application-test.properties 
 
Step 1: Add H2 Database Dependency 
Add to your pom.xml: 
    <!-- H2 Database for Testing --> 
    <dependency> 
        <groupId>com.h2database</groupId> 
        <artifactId>h2</artifactId> 
        <scope>test</scope> 
    </dependency> 
 
Run All Integration Tests 
mvn test -Dtest=DomainControllerIntegrationTest 
 
Sample Example: 
  [Type here] 
 
@SpringBootTest                 // ← Loads full Spring context


key: chroma:document
string_value:
@AutoConfigureMockMvc          // ← Provides MockMvc for HTTP testing 
@Transactional                 // ← Rollback after each test 
class DomainControllerIntegrationTest { 
     
    @Autowired 
    private MockMvc mockMvc;            // ← Simulates HTTP requests 
     
    @Autowired 
    private DomainRepository repository; // ← Real repository 
     
    @Test 
    @WithMockUser(authorities = "Admin") // ← Mock security 
    void testListDomains_Success() throws Exception {


key: chroma:document
string_value:
// Insert REAL data into database 
        Domain domain = new Domain(); 
        domain.setDomainName("Test"); 
        repository.save(domain);  // ← Actually saves to H2 database 
         
        // Make REAL HTTP request 
        mockMvc.perform(get("/domain/list")) 
            .andExpect(status().isOk()) 
            .andExpect(jsonPath("$.domain", hasSize(1))); 
    } 
} 
 
MockMvc Request Patterns 
GET Request  [Type here] 
 
java 
mockMvc.perform(get("/domain/list")


key: chroma:document
string_value:
java 
mockMvc.perform(get("/domain/list") 
        .param("page", "0") 
        .param("size", "10") 
        .param("search", "test") 
        .contentType(MediaType.APPLICATION_JSON)) 
    .andExpect(status().isOk()) 
    .andExpect(jsonPath("$.domain").isArray()); 
POST Request 
java 
mockMvc.perform(post("/domain/create") 
        .contentType(MediaType.APPLICATION_JSON) 
        .content(jsonString)) 
    .andExpect(status().isCreated())


key: chroma:document
string_value:
.andExpect(status().isCreated()) 
    .andExpect(jsonPath("$.error").value("false")); 
PUT Request 
java 
mockMvc.perform(put("/domain/update") 
        .contentType(MediaType.APPLICATION_JSON) 
        .content(jsonString)) 
    .andExpect(status().isOk()); 
DELETE Request 
java 
mockMvc.perform(delete("/domain/delete/{id}", domainId) 
        .contentType(MediaType.APPLICATION_JSON)) 
    .andExpect(status().isOk()); 
 
    Common JSON Path Expressions 
java 
// Check string value


key: chroma:document
string_value:
java 
// Check string value 
.andExpect(jsonPath("$.error").value("false"))  [Type here] 
 
 
// Check boolean 
.andExpect(jsonPath("$.error").value(false)) 
 
// Check number 
.andExpect(jsonPath("$.totalElements").value(10)) 
 
// Check array size 
.andExpect(jsonPath("$.domain", hasSize(5))) 
 
// Check array exists 
.andExpect(jsonPath("$.domain").isArray()) 
 
// Check nested value 
.andExpect(jsonPath("$.domain[0].domainName").value("Test")) 
 
// Check exists


key: chroma:document
string_value:
// Check exists 
.andExpect(jsonPath("$.message").exists()) 
 
// Check doesn't exist 
.andExpect(jsonPath("$.error").doesNotExist()) 
 
// Check not null 
.andExpect(jsonPath("$.domain").isNotEmpty())


