Home » Machine Learning/Artificial Intelligence

# Introduction to Quantifiers in the knowledge representation in an Agent (based on Artificial Intelligence)

In this article we are going to study about the **quantifiers and their need in knowledge representation in an intelligent agent**. We will study about the types of quantifiers, their properties, their applications and will also look at some examples for understanding them better.

Submitted by Monika Sharma, on June 04, 2019

As we know that in an AI-based agent, the knowledge is represented through two types of logic: **The propositional logic and the predicate logic**. In the propositional logic, we have declarative sentences, and in the predicate logic, we have a predicate defining a subject. But in both these systems, we were not able to define the quantity of any subject.

For example:

The predicate logic: **like(boy, apple)** defines that boy likes apple. But take a look at the following two statements:

- Some boys like apple
- All boys like apple

These sentences cannot be defined completely with the help of first-order predicate logic. So, to solve this issue, the **quantifiers** were used.

**Quantifiers** are the quantity defining terms which are used with the predicates.

## Types of quantifiers

There are two types of quantifiers:

### 1) Universal Quantifier

The universal quantifier is used to define the whole subject population under the predicate. It can be used anywhere where the phrases like: **'for all'**, **'for each'**, **'for every'** are used.

The symbol **'∀'** is used to represent universal Quantifier. To combine the universal quantifier with the predicate and the subject, implication sign, **'->'** is used.

**Example:**

∀x: Boy(x) -> like(x,Apple)

The above statement says that: **'All boys like apple'**.

### 2) Existential Quantifier

The Existential Quantifier is used at the places where only some part of the subject's population is to be defined under the predicate. It can be used at all the places where the following phrases are used: **'There exist'**, **'For some'**, **'For at least'**, etc.

The Existential Quantifier is represented by the symbol **'∃'**. To combine the Existential quantifier with the predicate and the subject, the conjunction symbol, **'^'** is used.

**Example:**

∃x: Boy(x) ^ like(x,apple)

The above statement depicts that there exists a boy who likes apple. Or we can say that there are some boys who like an apple.

## Properties of Quantifiers

**∀x.∀y**is the same as**∀y.∀x****∃x.∃y**is the same as**∃y.∃x****∃x.∀y**is not the same as**∀y.∃x****Quantifier duality:**Each quantifier can be expressed using the other one. This is done by complementing and changing the symbols.

**Example:**

∀x likes(x, Ice-cream) is equivalent to ~∃x ~likes(x, Ice-cream). ∃x likes(x, Chocolate) is equivalent to ~∀x ~likes(x, chocolate).

TOP Interview Coding Problems/Challenges

- Run-length encoding (find/print frequency of letters in a string)
- Sort an array of 0's, 1's and 2's in linear time complexity
- Checking Anagrams (check whether two string is anagrams or not)
- Relative sorting algorithm
- Finding subarray with given sum
- Find the level in a binary tree with given sum K
- Check whether a Binary Tree is BST (Binary Search Tree) or not
- 1[0]1 Pattern Count
- Capitalize first and last letter of each word in a line
- Print vertical sum of a binary tree
- Print Boundary Sum of a Binary Tree
- Reverse a single linked list
- Greedy Strategy to solve major algorithm problems
- Job sequencing problem
- Root to leaf Path Sum
- Exit Point in a Matrix
- Find length of loop in a linked list
- Toppers of Class
- Print All Nodes that don't have Sibling
- Transform to Sum Tree
- Shortest Source to Destination Path

Comments and Discussions