CS 4365 Articial Intelligence
Spring 2014
Assignment 3: Knowledge Representation and Reasoning
Part I: Due electronically by Monday, March 24, 11:59 p.m.
Part II: Due electronically by Monday, March 31, 11:59 p.m.
Part I: Programming (100 points)
In this
Discrete Math for Computing
Ch 4.3 Primes and Greatest Common Divisors
Primes
What is a prime number?
Positive integers that have exactly two different
positive integer factors are called primes
A positive integer p > 1 is called prime
if the only positiv
Discrete Math for Computing
Ch 4.4 Solving Congruences
Linear Congruences
A congruence of the form
ax b (mod m) is a linear congruence
where m is a positive integer,
a and b are integers,
and x is a variable
Solving Congruences
If an integer exists such t
Discrete Math for Computing
Ch 5.4 Section Summary
Recursive Algorithms
Proving Recursive Algorithms Correct
Merge Sort
Recursive Merge Sort
Recursive Algorithms
Definition:
An algorithm is called recursive if it solves a problem
by reducing it to an inst
Discrete Math for Computing
Ch 8.1 Section Summary
Recurrence Relations
Applications of Recurrence Relations
Fibonacci Numbers
The Tower of Hanoi
Counting Bit Strings
Recurrence Relations
Definition: A recurrence relation for the
sequence cfw_an - eq
Discrete Math for Computing
Ch 8.2 Section Summary
Linear Homogeneous Recurrence Relations
Solving linear Homogeneous Recurrence
Relations
Solving Linear Homogeneous Recurrence
Relations with Constant Coefficients
Linear Homogeneous Recurrence Relation
Discrete Mathematics for Computing
Ch 9.1 Relations and Their Properties
Motivation
Relationships between set elements occur in many
contexts
What are some of the relationships?
Any business and its telephone number
An employee and his or her salary
Compu
Discrete Mathematics for Computing
Ch 9.2 n-ary Relations and Their Applications
Motivation:
- Relationships among elements of more than two sets
Flight: Airline, Flight number, starting point, destination,
departure time, arrival time
n-ary Relations
n-a
Discrete Mathematics for Computing
Ch 9.4 Closures of Relations
Definition: The closure of a relation R with respect
to property P is the relation obtained by adding the
minimum number of ordered pairs to R to obtain
property P.
Properties: reflexive, sym
Discrete Mathematics for Computing
Ch 9.5 Equivalence Relations
A relation on set A is called an equivalence
relation if it is:
reflexive,
symmetric, and
transitive
Equivalence Relations
Two elements a and b that are related by an
equivalence relation ar
Discrete Mathematics for Computing
Ch 9.6 Partial Orderings
A relation R on a set S is called a partial
ordering or partial order if it is:
reflexive
antisymmetric
transitive
A set S together with a partial ordering R is
called a partially ordered set, or
Discrete Mathematics for Computing
Ch 10.1 Graphs
Graphs: Discrete structures consisting of vertices and
edges that connect these vertices
Graphs
There are 5 main categories of graphs:
- Simple graph
- Multigraph
- Pseudograph
- Directed graph
- Directed
Discrete Mathematics for Computing
Ch 10.2: Graph Terminology and Special Types of
Graphs
Basic Terminology
Goal: Introduce graph terminology in order to further classify
graphs
Definition 1: Two vertices u and v in an undirected graph G
- are called adja
Discrete Mathematics for Computing
Dr. Pushpa Kumar
Ch 10.3 Representing Graphs and Graph
Isomorphism
Discussion
Have you seen graphs before?
If yes, what types?
Can graphs have different structures?
Chemical Compounds
Adjacency Lists
Used to represe
Discrete Mathematics for Computing
Dr. Pushpa Kumar
Ch 10.4: Connectivity
Problems modeled with paths formed by
traveling along the edges of graphs
Routes for mail delivery
Diagnostics in computer networks
Paths in Undirected Graphs
There is a path from
Discrete Mathematics for Computing
Ch 10.5 Euler and Hamilton Paths
Can we travel along the edges of a graph
starting at a vertex and return to it by
traversing each edge of the graph exactly
once? Euler circuit
Can we travel along the edges of a graph
Discrete Math for Computing
Ch 4.2 Integer Representations and Algorithms
What is an integer?
Subset of real numbers formed by the natural numbers
together with the negatives of the non-zero natural
numbers
Set Z -> cfw_., 2, 1, 0, 1, 2, .
What is an algo
Discrete Math for Computing
Ch 4.1 Divisibility and Modular
Arithmetic
Number Theory Part of mathematics involving the
integers and their properties
Divisibility
Division of an integer by a positive integer
Quotient, Remainder
Modular Arithmetic
Applicati
Exercise 5
Problem 1.
Consider the set consisting of the following clauses:
p0 p1 p2 ,
p0 p2 ,
p0 p1 ,
p1 p2 ,
p0 p1 p2 .
Show how GSAT can nd a model of this set starting with the initial
random interpretation cfw_p0 1, p1 0, p2 1.
Problem 2.
Consider th
Exercise 1 (deadline: October 4th, 3pm)
Exercise 3.1
The following formula has its parentheses removed. Restore the
parentheses.
p1 p2 p3 p4 .
Exercise 3.9
Show that the formulas p (q r ) and (p q) r are not
equivalent by nding an interpretation in which
Exercise 2
Problem 1
Build a truth table for the following formula
p (r p).
Problem 2
Check, using splitting, whether the formula
(p q) (p q) (q p) is satisable. Split on the atom p rst.
Exercise 4
Problem 1.
Apply the DPLL algorithm to the following sets of clauses:
pqr s
p r s
p q r
q r
r s
p q s
p q
p q r s
p q s
Is this set satisable? If yes, nd a model of this set.
Problem 2.
Convert the formula p q p q to CNF using the denitional
cl
Exercise 6
Problem 1.
Show the OBDD for the formula p q (p q) r and the order
p > q > r.
Problem 2.
Consider the following global dag D.
p
p
q
q
r
r
0
1
It has two different subdags d1 , d2 rooted at p. Let d1 , d2 represent
formulas F1 , F2 , respectivel
Exercise 7
Problem 1.
Draw the parse tree for the following formula:
(p(r r p) q) (q(r r q) p).
Mark all bound occurrences of variables in this formula.
Problem 2.
For the parse tree of Problem 1, mark each node with the polarity of
this node.
Problem 3.
Exercise 8
Problem 1
Evaluate the following formula using the Splitting Algorithm:
r qp(p (p r ) q).
Problem 2
Evaluate the following formula using only the pure literal rule,
universal literal deletion and unit propagation.
pqr s(p q s) (p q r ) (q r s).
Exercise 9
Problem 1.
Take the domain axiom for a variable whose domain contains 1000
values and transform this axiom into CNF using the standard CNF
transformation. What is the number of clauses in the resulting CNF?
Problem 2.
Let x be a variable with t
Exercise 10
Problem 1.
Let F be a formula. Represent in LTL the following property of a path
s0 , s1 . . .: a formula F holds in all states of the form s4k and s4k +1 ,
where k = 0, 1, . . . and does not hold in all other states.
Problem 2.
Consider the f
Exercise 11
Consider a transition system with the following state transition graph.
x=1
y=0
x=0
y=0
x=0
y=1
Let S1 be the set of states symbolically represented by the formula
x = 1 and S2 be the set of states symbolically represented by the
formula x = 0
6.825 Exercise Problems
Weeks 1 and 2
September 23, 2004
1
A Problem-Solving Problem
A Mars rover has to leave the lander, collect rock samples from three places (in any order) and return to the
lander.
Assume that it has a navigation module that can take