You are on page 1of 5

MEMORANDUM

Do not duplicate

CMPG313: Artificial Intelligence Duration: 90 minutes

1 Question 1: Propositional Logic / Vraag 1: Proposisielogika [18]

1.1 In propositional calculus, the equivalence rule holds. Prove that this identity is
valid by means of a truth table. (Prove: (P⇒Q)∧(Q⇒P) ≡ (P ⇔ Q) ).

In proposisielogika geld die ekwivalensiereël. Bewys dat hierdie reël geldig is met
behulp van 'n waarheidstabel. (Bewys: (P ⇒ Q)∧(Q ⇒ P) ≡ (P ⇔ Q) ). (6)

1.2 Fill in the correct symbol on the right to match the descriptions in the left
column:
Vul die regte simbool aan die regterkant in om by die beskrywings in die linker
kolom te pas: (3)

F1 is semantically equivalent to F2 F1 ≡ F2

F1 is syntactically equivalent to F2 F1 ⇔ F2

F1 implies F2 F1 ⇒ F2

F1 entails F2 F1 ╞ F2

F2 is derived from F1 F1 ├ F2

F2 follows from F1 F1 ╞ F2

CMPG313: 2022 Mid Semester Test 1/5


1.3 Let P, Q, R and S denote the following propositions: (9)

P: Paul buys bitcoin.


Q: Queen wins.
R: Money is lost.
S: Sam plays poker.

Write each of the following propositions in the abstracted form.

Paul buys bitcoin but Sam does not play poker. (1)
P ∧ ¬S

If Paul does not buy bitcoin and Sam does not play poker, then no money is lost. (2)
¬P ∧ ¬S ⇒ ¬R

Sam does not play poker if Paul buys bitcoin. (1)


P ⇒ ¬S

If Sam plays poker or Paul buys bitcoin then money is lost. (2)
S∨P⇒R

Queen wins if money is lost or both Paul buys bitcoin and Sam plays poker. (3)

R ∨ (S ∧ P) ⇒ Q

2 Question 2: Predicate Logic / Vraag 2: Predikaatlogika [8 ]

Write an English sentence for each of the following predicate logic formulas.

∃X bought(peter,X). (1)

Peter bought something.

∀X bought(peter,X) ⇒ bought(sam,X). (2)


If Peter bought anything, then Sam bought the same thing.
Alternative: (Whatever Peter bought, Sam also bought it.)

∀X ∃Y bought(X,Y). (1)
Everyone bought something.

∃X ∀Y bought(X,Y). (1)
Someone bought everything.

∀X play(peter,X) ⇒ player(peter) ∧ game(X) (3)


If Peter plays anything it implies he is a player and that it is a game.

CMPG313: 2022 Mid Semester Test 2/5


3 Question 3: Limits of Logic / Vraag 3: Beperkings van logika [6 ]

Given the knowledge below answer the questions that follow.

1. penguin(tux)
2. duck(donald)
3. swim(donald)
4. ∀X penguin(X) ⇒ seabird(X)
5. ∀X seabird(X) ⇒ swim(X)

3.1 Use resolution to show that tux can swim (2)


6. Res. 1,4: penguin(tux) ⇒ seabird(tux)
7. Res. 5,6: seabird(tux) ⇒ swim(tux)

3.2 Would it be possible to use a truth table to show that tux can swim?
Why? / Why not? (2)

No, because truth tables cannot be used for Universal Quantifiers of PL1.

3.3 Is it necessary to add statement(s) to the knowledge base which will prevent the
deduction that donald is a seabird?
If so write that statement(s).
If not then explain why not (2)

...

4 Question 4: State spaces and search


/ Vraag 4: Toestandruimtes en soek [13]

Given the following start state of a simple blocks world, generate the state space
according to the following rules:
1. One block can be moved at a time.
2. A block cannot be moved if there is another block on top of it.
3. Blocks can be placed in one of the three positions on the table or stacked.
4. Blocks on the same level must be to the left of other blocks with higher numbers.
5. Blocks on the same stack must be on top of other blocks with higher numbers.
6. Do not allow duplicate states.

CMPG313: 2022 Mid Semester Test 3/5


1 2 3

1 1 2
2 3 2 3 1 3

1
1 2 2
2 3 1 3 3

1
2 3

1
2 3

1
2 3
4.1 Draw the state space here. (10)

4.2 What is the average branching factor of this state space? (1)

(3 + 1 + 2 + 1 + 1 + 1) / 6 = 1.5

4.3 Would it be useful to do a cycle check when generating the state space? Motivate your answer.
(2)

Yes, we want to avoid cycles because cycles can occur and that would make the state
space infinite

CMPG313: 2022 Mid Semester Test 4/5


5 Question 5: Uninformed Search / Vraag 5: [5 ]

5.1 Compare the uninformed search algorithms by completing the table below.

U. (4)

Breadth-first search Depth-first search

Completeness Yes No

Optimal solution Yes No

Computation time bd ∞ or bd

Memory use bd bd

5.2 Which algorithm is better that both Breadth-first search and Depth-first search with
regard to the 4 categories in the table above?

iterative deepening (1)

TOTAL/TOTAAL: 50

CMPG313: 2022 Mid Semester Test 5/5

You might also like