• Home
  • Textbooks
  • Artificial Intelligence. A Modern Approach [Global Edition]
  • First-Order Logic

Artificial Intelligence. A Modern Approach [Global Edition]

Stuart Russell, Peter Norvig

Chapter 8

First-Order Logic - all with Video Answers

Educators


Chapter Questions

Problem 1

A logical knowledge base represents the world using a set of sentences with no explicit structure. An analogical representation, on the other hand, has physical structure that corresponds directly to the structure of the thing represented. Consider a road map of your country as an analogical representation of facts about the country - it represents facts with a map language. The two-dimensional structure of the map corresponds to the two-dimensional surface of the area.
a. Give five examples of symbols in the map language.
b. An explicit sentence is a sentence that the creator of the representation actually writes down. An implicit sentence is a sentence that results from explicit sentences because of properties of the analogical representation. Give three examples each of implicit and explicit sentences in the map language.
c. Give three examples of facts about the physical structure of your country that cannot be represented in the map language.
d. Give two examples of facts that are much easier to express in the map language than in first-order logic.
e. Give two other examples of useful analogical representations. What are the advantages and disadvantages of each of these languages?

Check back soon!

Problem 2

Consider a knowledge base containing just two sentences: $P(a)$ and $P(b)$. Does this knowledge base entail $\forall x P(x)$ ? Explain your answer in terms of models.

Check back soon!
01:19

Problem 3

Is the sentence $\exists x, y \quad x=y$ valid? Explain.

Julie Silva
Julie Silva
Numerade Educator
01:06

Problem 4

Write down a logical sentence such that every world in which it is true contains exactly two objects.

Kerry Thornton-Genova
Kerry Thornton-Genova
Numerade Educator

Problem 5

Consider a symbol vocabulary that contains $c$ constant symbols, $p_k$ predicate symbols of each arity $k$, and $f_k$ function symbols of each arity $k$, where $1 \leq k \leq A$. Let the domain size be fixed at $D$. For any given model, each predicate or function symbol is mapped onto a relation or function, respectively, of the same arity. You may assume that the functions in the model allow some input tuples to have no value for the function (i.e., the value is the invisible object). Derive a formula for the number of possible models for a domain with $D$ elements. Don't worry about eliminating redundant combinations.

Check back soon!
01:30

Problem 6

Which of the following are valid (necessarily true) sentences?
a. $(\exists x x=x) \Rightarrow(\forall y \exists z y=z)$.
b. $\forall x P(x) \vee \neg P(x)$.
c. $\forall x \operatorname{Smart}(x) \vee(x=x)$.

Adriano Chikande
Adriano Chikande
Numerade Educator

Problem 7

Consider a version of the semantics for first-order logic in which models with empty domains are allowed. Give at least two examples of sentences that are valid according to the standard semantics but not according to the new semantics. Discuss which outcome makes more intuitive sense for your examples.

Check back soon!
02:47

Problem 8

Does the fact $\neg$ Spouse (George, Laura) follow from the facts Jim $\neq$ George and Spouse(Jim, Laura)? If so, give a proof; if not, supply additional axioms as needed. What happens if we use Spouse as a unary function symbol instead of a binary predicate?

Jay Patel
Jay Patel
Numerade Educator

Problem 9

Consider a vocabulary with the following symbols:
Occupation $(p, o)$ : Predicate. Person $p$ has occupation $o$.
Customer $(p 1, p 2)$ : Predicate. Person $p 1$ is a customer of person $p 2$.
Boss $(p 1, p 2)$ : Predicate. Person $p 1$ is a boss of person $p 2$.
Doctor, Surgeon, Lawyer, Actor: Constants denoting occupations.
Emily, Joe: Constants denoting people.

Use these symbols to write the following assertions in first-order logic:
a. Emily is either a surgeon or a lawyer.
b. Joe is an actor, but he also holds another job.
c. All surgeons are doctors.
d. Joe does not have a lawyer (i.e., is not a customer of any lawyer).
e. Emily has a boss who is a lawyer.
f. There exists a lawyer all of whose customers are doctors.
g. Every surgeon has a lawyer.

Check back soon!

Problem 10

In each of the following we give an English sentence and a number of candidate logical expressions. For each of the logical expressions, state whether it (1) correctly expresses the English sentence; (2) is syntactically invalid and therefore meaningless; or (3) is syntactically valid but does not express the meaning of the English sentence.
a. Every cat loves its mother or father.
(i) $\forall x \operatorname{Cat}(x) \Rightarrow \operatorname{Loves}(x, \operatorname{Mother}(x) \vee$ Father $(x))$.
(ii) $\forall x \neg \operatorname{Cat}(x) \vee \operatorname{Loves}(x, \operatorname{Mother}(x)) \vee \operatorname{Loves}(x$, Father $(x))$.
(iii) $\forall x \operatorname{Cat}(x) \wedge(\operatorname{Loves}(x$, Mother $(x)) \vee$ Loves $(x$, Father $(x)))$.
b. Every dog who loves one of its brothers is happy.
(i) $\forall x \operatorname{Dog}(x) \wedge(\exists y$ Brother $(y, x) \wedge$ Loves $(x, y)) \Rightarrow \operatorname{Happy}(x)$.
(ii) $\forall x, y \operatorname{Dog}(x) \wedge B$ Brother $(y, x) \wedge \operatorname{Loves}(x, y) \Rightarrow \operatorname{Happy}(x)$.
(iii) $\forall x \operatorname{Dog}(x) \wedge[\forall y$ Brother $(y, x) \Leftrightarrow \operatorname{Loves}(x, y)] \Rightarrow \operatorname{Happy}(x)$.
c. No dog bites a child of its owner.
(i) $\forall x \operatorname{Dog}(x) \Rightarrow \neg$ Bites $(x$, Child $($ Owner $(x)))$.
(ii) $\neg \exists x, y \operatorname{Dog}(x) \wedge \operatorname{Child}(y$, Owner $(x)) \wedge \operatorname{Bites}(x, y)$.
(iii) $\forall x \operatorname{Dog}(x) \Rightarrow(\forall y \operatorname{Child}(y$, Owner $(x)) \Rightarrow \neg$ Bites $(x, y))$.
(iv) $\neg \exists x \operatorname{Dog}(x) \Rightarrow(\exists y$ Child $(y$, Ouner $(x)) \wedge \operatorname{Bites}(x, y))$.
d. Everyone's zip code within a state has the same first digit.
(i) $\forall x, s, z_1\left[\operatorname{State}(s) \wedge \operatorname{LivesIn}(x, s) \wedge Z i p(x)=z_1\right] \Rightarrow$ $\left[\forall y, z_2 \operatorname{LivesIn}(y, s) \wedge \operatorname{Zip}(y)=z_2 \Rightarrow \operatorname{Digit}\left(1, z_1\right)=\operatorname{Digit}\left(1, z_2\right)\right]$.
(ii) $\forall x, s\left[\right.$ State $\left.(s) \wedge \operatorname{LivesIn}(x, s) \wedge \exists z_1 \quad Z i p(x)=z_1\right] \Rightarrow$ $\left[\forall y, z_2 \operatorname{LivesIn}(y, s) \wedge \operatorname{Zip}(y)=z_2 \wedge \operatorname{Digit}\left(1, z_1\right)=\operatorname{Digit}\left(1, z_2\right)\right]$.
(iii) $\forall x, y, s \operatorname{State}(s) \wedge \operatorname{LivesIn}(x, s) \wedge \operatorname{LivesIn}(y, s) \Rightarrow \operatorname{Digit}(1, Z i p(x)=Z i p(y))$.
(iv) $\forall x, y, s \operatorname{State}(s) \wedge \operatorname{LivesIn}(x, s) \wedge \operatorname{LivesIn}(y, s) \Rightarrow$ $\operatorname{Digit}(1, \operatorname{Zip}(x))=\operatorname{Digit}(1, \operatorname{Zip}(y))$.

Check back soon!
02:18

Problem 11

Complete the following exercises about logical senntences:
a. Translate into good, natural English (no $x \mathrm{~s}$ or $y \mathrm{~s}$ !):
$\forall x, y, l$ SpeaksLanguage $(x, l) \wedge$ SpeaksLanguage $(y, l)$
$\Rightarrow$ Understands $(x, y) \wedge$ Understands $(y, x)$.
b. Explain why this sentence is entailed by the sentence
$\forall x, y, l$ SpeaksLanguage $(x, l) \wedge$ SpeaksLanguage $(y, l)$
$\Rightarrow$ Understands $(x, y)$.
c. Translate into first-order logic the following sentences:
(i) Understanding leads to friendship.
(ii) Friendship is transitive.
Remember to define all predicates, functions, and constants you use.

Christopher Stanley
Christopher Stanley
Numerade Educator
00:57

Problem 12

True or false? Explain.
a. $\exists x \quad x=$ Rumpelstiltskin is a valid (necessarily true) sentence of first-order logic.
b. Every existentially quantified sentence in first-order logic is true in any model that contains exactly one object.
c. $\forall x, y x=y$ is satisfiable.

Subhadeepta Sahoo
Subhadeepta Sahoo
Numerade Educator

Problem 13

Rewrite the first two Peano axioms in Section 8.3.3 as a single axiom that define $\operatorname{NatNum}(x)$ so as to exclude the possibility of natural numbers except for those generated by the successor function.

Check back soon!

Problem 14

Equation (8.4) on page 306 defines the conditions under which a square is breezy. Her we consider two other ways to describe this aspect of the wumpus world.
a. We can write diagnostic rules leading from observed effects to hidden causes. For find ing pits, the obvious diagnostic rules say that if a square is breezy, some adjacent square must contain a pit; and if a square is not breezy, then no adjacent square contains a pit Write these two rules in first-order logic and show that their conjunction is logically equivalent to Equation (8.4).
b. We can write causal rules leading from cause to effect. One obvious causal rule is tha a pit causes all adjacent squares to be breezy. Write this rule in first-order logic, explain why it is incomplete compared to Equation (8.4), and supply the missing axiom.

Check back soon!
01:32

Problem 15

Write axioms describing the predicates Grandchild, Greatgrandparent, Ancestor, Brother, Sister, Daughter, Son, FirstCousin, BrotherInLaw, SisterInLaw, Aunt, and Uncle. Find out the proper definition of $m$ th cousin $n$ times removed, and write the definition in first-order logic. Now write down the basic facts depicted in the family tree in Figure 8.7. Using a suitable logical reasoning system, TELL it all the sentences you have written down, and ASK it who are Elizabeth's grandchildren, Diana's brothers-in-law, Zara's great-grandparents, and Eugenie's ancestors.

Amy Jiang
Amy Jiang
Numerade Educator
01:09

Problem 16

Write down a sentence asserting that + is a commutative function. Does your sentence follow from the Peano axioms? If so, explain why; if not, give a model in which the axioms are true and your sentence is false.

Zach Steedman
Zach Steedman
Numerade Educator
03:03

Problem 17

Using the set axioms as examples, write axioms for the list domain, including all the constants, functions, and predicates mentioned in the chapter.

Christopher Stanley
Christopher Stanley
Numerade Educator
01:27

Problem 18

Explain what is wrong with the following proposed definition of adjacent squares in the wumpus world:
$$
\forall x, y \operatorname{Adjacent}([x, y],[x+1, y]) \wedge \operatorname{Adjacent}([x, y],[x, y+1]) .
$$

Lucas Finney
Lucas Finney
Numerade Educator
01:56

Problem 19

Write out the axioms required for reasoning about the wumpus's location, using a constant symbol Wumpus and a binary predicate At(Wumpus, Location). Remember that there is only one wumpus.

Adriano Chikande
Adriano Chikande
Numerade Educator
02:18

Problem 20

Assuming predicates Parent $(p, q)$ and Female $(p)$ and constants Joan and Kevin, with the obvious meanings, express each of the following sentences in first-order logic. (You may use the abbreviation $\exists^1$ to mean "there exists exactly one.")
a. Joan has a daughter (possibly more than one, and possibly sons as well).
b. Joan has exactly one daughter (but may have sons as well).
c. Joan has exactly one child, a daughter.
d. Joan and Kevin have exactly one child together.

Christopher Stanley
Christopher Stanley
Numerade Educator
05:06

Problem 21

Arithmetic assertions can be written in first-order logic with the predicate symbol $<$, the function symbols + and $\times$, and the constant symbols 0 and 1 . Additional predicates can also be defined with biconditionals.
a. Represent the property " $x$ is an even number."
b. Represent the property " $x$ is prime."
c. Goldbach's conjecture is the conjecture (unproven as yet) that every even number is equal to the sum of two primes. Represent this conjecture as a logical sentence.

Nick Johnson
Nick Johnson
Numerade Educator

Problem 22

In Chapter 6, we used equality to indicate the relation between a variable and its value. For instance, we wrote $W A=$ red to mean that Western Australia is colored red. Representing this in first-order logic, we must write more verbosely $\operatorname{Color} O f(W A)=\operatorname{red}$. What incorrect inference could be drawn if we wrote sentences such as $W A=$ red directly as logical assertions?

Check back soon!
05:18

Problem 23

Write in first-order logic the assertion that every key and at least one of every pair of socks will eventually be lost forever, using only the following vocabulary: $\operatorname{Key}(x), x$ is a key; Sock $(x), x$ is a sock; Pair $(x, y), x$ and $y$ are a pair; Now, the current time; Before $\left(t_1, t_2\right)$, time $t_1$ comes before time $t_2 ; \operatorname{Lost}(x, t)$, object $x$ is lost at time $t$.

Willis James
Willis James
Numerade Educator

Problem 24

Translate into first-order logic the sentence "Everyone's DNA is unique and is derived from their parents' DNA." You must specify the precise intended meaning of your vocabulary terms. (Hint: Do not use the predicate Unique $(x)$, since uniqueness is not really a property of an object in itself!)

Check back soon!

Problem 25

For each of the following sentences in English, decide if the accompanying first-order logic sentence is a good translation. If not, explain why not and correct it.
a. Any apartment in London has lower rent than some apartments in Paris.
$$
\begin{aligned}
& \forall x \quad[\operatorname{Apt}(x) \wedge \operatorname{In}(x, \text { London })] \Rightarrow \exists y([\operatorname{Apt}(y) \wedge \operatorname{In}(y, \text { Paris })] \Rightarrow \\
& (\operatorname{Rent}(x)<\operatorname{Rent}(y))) .
\end{aligned}
$$
b. There is exactly one apartment in Paris with rent below $\$ 1000$.
$$
\begin{aligned}
& \exists x \operatorname{Apt}(x) \wedge \operatorname{In}(x, \text { Paris }) \wedge \\
& \quad \forall y[\operatorname{Apt}(y) \wedge \operatorname{In}(y, \text { Paris }) \wedge(\operatorname{Rent}(y)<\text { Dollars }(1000))] \Rightarrow(y=x) .
\end{aligned}
$$
c. If an apartment is more expensive than all apartments in London, it must be in Moscow.
$$
\begin{aligned}
& \forall x \quad \operatorname{Apt}(x) \wedge[\forall y \operatorname{Apt}(y) \wedge \operatorname{In}(y, \operatorname{London}) \wedge(\operatorname{Rent}(x)>\operatorname{Rent}(y))] \Rightarrow \\
& \quad \operatorname{In}(x, \text { Moscow }) .
\end{aligned}
$$

Check back soon!
06:40

Problem 26

Represent the following sentences in first-order logic, using a consistent vocabulary (which you must define):
a. Some students took French in spring 2009.
b. Every student who takes French passes it.
c. Only one student took Greek in spring 2009.
d. The best score in Greek is always lower than the best score in French.
e. Every person who buys a policy is smart.
f. There is an agent who sells policies only to people who are not insured.
g. There is a barber who shaves all men in town who do not shave themselves.
h. A person born in the UK, each of whose parents is a UK citizen or a UK resident, is a UK citizen by birth.
i. A person born outside the UK, one of whose parents is a UK citizen by birth, is a UK citizen by descent.
j. Politicians can fool some of the people all of the time, and they can fool all of the people some of the time, but they can't fool all of the people all of the time.
k. All Greeks speak the same language. (Use $\operatorname{Speaks}(x, l)$ to mean that person $x$ speaks language $l$.)

Rosina Dapaah
Rosina Dapaah
Numerade Educator
01:45

Problem 27

Write a general set of facts and axioms to represent the assertion "Wellington heard about Napoleon's death" and to correctly answer the question "Did Napoleon hear about Wellington's death?"

Amy Jiang
Amy Jiang
Numerade Educator

Problem 28

Extend the vocabulary from Section 8.4 to define addition for $n$-bit binary numbers. Then encode the description of the four-bit adder in Figure 8.8, and pose the queries needed to verify that it is in fact correct.

Check back soon!

Problem 29

The circuit representation in the chapter is more detailed than necessary if we care only about circuit functionality. A simpler formulation describes any $m$-input, $n$-output gate or circuit using a predicate with $m+n$ arguments, such that the predicate is true exactly when the inputs and outputs are consistent. For example, NOT gates are described by the binary predicate $N O T(i, o)$, for which $N O T(0,1)$ and $\operatorname{NOT}(1,0)$ are known. Compositions of gates are defined by conjunctions of gate predicates in which shared variables indicate direct connections. For example, a NAND circuit can be composed from ANDs and NOTs:
$$
\forall i_1, i_2, o_a, o \operatorname{AND}\left(i_1, i_2, o_a\right) \wedge \operatorname{NOT}\left(o_a, o\right) \Rightarrow N A N D\left(i_1, i_2, o\right) .
$$
Using this representation, define the one-bit adder in Figure 8.6 and the four-bit adder in Figure 8.8, and explain what queries you would use to verify the designs. What kinds of queries are not supported by this representation that are supported by the representation in Section 8.4 ?

Check back soon!

Problem 30

Obtain a passport application for your country, identify the rules determining eligibility for a passport, and translate them into first-order logic, following the steps outlined in Section 8.4.

Check back soon!

Problem 31

Consider a first-order logical knowledge base that describes worlds containing people, songs, albums (e.g., "Meet the Beatles") and disks (i.e., particular physical instances of CDs). The vocabulary contains the following symbols:
CopyOf $(d, a)$ : Predicate. Disk $d$ is a copy of album $a$.
Owns $(p, d)$ : Predicate. Person $p$ owns disk $d$.
Sings $(p, s, a)$ : Album $a$ includes a recording of song $s$ sung by person $p$.
Wrote $(p, s)$ : Person $p$ wrote song $s$.
McCartney, Gershwin, BHoliday, Joe, EleanorRigby, TheManILove, Revolver:
Constants with the obvious meanings.

Express the following statements in first-order logic:
a. Gershwin wrote "The Man I Love."
b. Gershwin did not write "Eleanor Rigby."
c. Either Gershwin or McCartney wrote "The Man I Love."
d. Joe has written at least one song.
e. Joe owns a copy of Revolver.
f. Every song that McCartney sings on Revolver was written by McCartney.
g. Gershwin did not write any of the songs on Revolver.
h. Every song that Gershwin wrote has been recorded on some album. (Possibly different songs are recorded on different albums.)
i. There is a single album that contains every song that Joe has written.
j. Joe owns a copy of an album that has Billie Holiday singing "The Man I Love."
k. Joe owns a copy of every album that has a song sung by McCartney. (Of course, each different album is instantiated in a different physical CD.)
I. Joe owns a copy of every album on which all the songs are sung by Billie Holiday.

Check back soon!