Ladies or Tigers The Second Case
Raymond Smullyan provides, in The Lady or the Tiger?, the
following context for a number of puzzles to follow:
Mathematics for Computing
[.] the king explained to the prisoner that each of the two rooms
contained either a
Anything Wrong?
=
=
=
=
=
=
=
f
:
g
:
NN
NB
f .n
:=
( i
g.n
:
( i
g( 2 )
hDef. gi
( i i = 2 i < f .i )
hOne-point rule (8.14)i
2 < f .2
hDef. f i
i < 2 i + 2)
2 < ( i
hi : N < 2 i = 0 i = 1 i
2 < ( i
i = 0 i = 1 i + 2)
hRange split; One-pt. rulei
2 < (0 +
Calculate!
The size of a finite set S, that is, the number of its elements,
is written # S
# cfw_1, 2
# cfw_1, 1
# cfw_1
# cfw_
# cfw_
# cfw_
# cfw_, cfw_
# cfw_, cfw_
# (cfw_1, 2, 3 cfw_3, 4)
# (cfw_1, 2, 3 cfw_3, 4)
# (cfw_1, 2, 3 cfw_3, 4)
# (cfw_1, 2,
McMaster University
Department of Computing and Software
Dr. W. Kahl
COMP SCI 1FC3 Mathematics for
4 March 2012
Implication
(3.57)
(3.58)
(3.59)
(3.60)
(3.61)
(3.62)
(3.63)
(3.64)
(3.65)
(3.66)
(3.67)
(3.68)
(3.69)
(3.70)
(3.71)
(3.72)
(3.73)
(3.74)
(3.75
McMaster University
Department of Computing and Software
Dr. W. Kahl
COMP SCI 1FC3
Sheet 13
Solution Hints
COMP SCI 1FC3 Mathematics for Computing
28 March 2013
Exercise 13.1
Composition of two arbitrary relations R : B C and S : C D between the three set
Reachability
Recall:
Transitive closure R+ is reachability via at least one R-step
Reflexive transitive closure R is reachability via any number of
R-steps
Let a directed graph G = (V, E) with vertex/node set V and edge
relation E : V V be given.
Formalis
Raymond Smullyan posed many puzzles about an island that
has two kinds of inhabitants:
knights, who always tell the truth, and
knaves, who always lie.
You encounter two people A and B.
What are A and B if
1
A says We are both knaves.?
2
A says At least on
McMaster University
Department of Computing and Software
Dr. W. Kahl
COMP SCI 1FC3 (4.4)
[Gries & Schneider]
Theorem List 2
COMP SCI 1FC3 Mathematics for Computing
(4.6)
4 March 2012
Implication
(3.57)
(3.58)
(3.59)
(3.60)
(3.61)
(3.62)
(3.63)
(3.64)
(3.6
Anything Wrong?
Let the set Q be defined by the following:
Q = cfw_S
(R)
S
/ S
Anything Wrong?
Let the set Q be defined by the following:
Q = cfw_S
(R)
Then:
Then:
QQ
QQ
h (R) i
S
/ S
Q cfw_S
=
h(11.3) Membership in set comprehensioni
/ S Q = S
( S S
=
h
Axioms and Theorems: Equiv., Neg., Disjunction
Fill in all axioms and named theorems
Prove all non-axiom theorems from
lower-numbered theorems
(3.1) Axiom, Associativity of :
(3.2) Axiom, Symmetry of :
(3.3) Axiom, Identity of :
(3.4) true
(3.5) Reflexivi
McMaster University
Department of Computing and Software
Dr. W. Kahl
COMP SCI 1FC3
Sheet 14
Solution Hints
COMP SCI 1FC3 Mathematics for Computing
8 April 2013
Exercise 14.1: Relational Formalisation
Translate the following English statements into mathema
McMaster University
Department of Computing and Software
Dr. W. Kahl
COMP SCI 1FC3
Sheet 12
COMP SCI 1FC3 Mathematics for Computing
25 March 2013
Solutions to all Asssignment Questions on this sheet are due as a single PDF document
constructed from scans
Anything Wrong?
Mathematics for Computing
2 x + y (x + y + 1 ) 2
=
hAssumption x + y = 8 zi
2 x + y (8 z + 1)2
COMP SCI 1FC3
McMaster University, Winter 2013
Wolfram Kahl
2 x + y (x + y + 1 ) 2
=
hAssumption x + y = 8 zi
[email protected]
27 February 2
Write down all propositional axioms of the Equational Logic E
from the textbook as Boolean expressions with their names:
Write down all propositional axioms of the Equational Logic E
from the textbook as Boolean expressions with their names:
1
(3.1) Assoc
McMaster University
Department of Computing and Software
Dr. W. Kahl
COMP SCI 1FC3 Exercise 9.3
Sheet 9
Turn each of the following informal expressions into a sum quantification
(thereby documenting your guesses what the dots mean in those
cases that cont
McMaster University
Department of Computing and Software
Dr. W. Kahl
COMP SCI 1FC3
Sheet 2
COMP SCI 1FC3 Mathematics for Computing
10 January 2013
Exercise 2.1
Translate the following sentences into Boolean expressions. You may choose to give names to the
Axioms Fill in the Blanks!
Anything Wrong?
false
(3.1) Axiom, Associativity of :
(3.2) Axiom, Symmetry of :
=
h(3.15) p p falsei
p p
=
h(3.11) p q p qi
p p q q
=
h(3.14) (p 6 q) p q, twicei
p 6 p 6 q q
(3.3) Axiom, Identity of :
(3.8) Axiom, Definition of
McMaster University
Department of Computing and Software
Dr. W. Kahl
COMP SCI 1FC3
Sheet 5
COMP SCI 1FC3 Mathematics for Computing
24 January 2013
Solutions to all Asssignmant Questions on this sheet are due as scans or readable
photographs of handwritten
McMaster University
Department of Computing and Software
Dr. W. Kahl
COMP SCI 1FC3
Sheet 3
COMP SCI 1FC3 Mathematics for Computing
14 January 2013
Solutions to all Asssignmant Questions and Assignment Items on this sheet are
due as scans (or readable phot
Portias Suitors Dilemma
(Textbook p. 86)
Portia has a gold casket and a silver casket
and has placed a picture of herself in one of them.
On the caskets, she has written the following inscriptions:
Gold:
The portrait is not in here
Silver:
Exactly one of
Anything Wrong?
true
=
=
=
=
=
=
=
h(3.3) Identity of i
pp
h(3.2) Symmetry of i
p q q p
h(3.14) (p 6 q) p qi
(p 6 q) q p
h(3.10) Definition of 6i
(p q) q p
h(3.9) Distributivity of over i
p q q p
h(3.2) Symmetry of i
p p
h(3.15) p p falsei
false
Mathemati
Warm-Up
Be Careful with provisos!
What does assuming the antecedent mean?
Mathematics for Computing
Give the rule for quantification nesting.
State the one-point rule and the empty range axiom.
COMP SCI 1FC3
State the quantification distributivity axiom.
McMaster University
Department of Computing and Software
Dr. W. Kahl
COMP SCI 1FC3
Sheet 10
COMP SCI 1FC3 Mathematics for Computing
4 March 2013
Solutions to all Asssignment Questions 10.* on this sheet are due
as a single PDF document constructed from sc
McMaster University
Department of Computing and Software
Dr. W. Kahl
COMP SCI 1FC3
Sheet 4
COMP SCI 1FC3 Mathematics for Computing
14 January 2013
Solutions to all Asssignmant Questions on this sheet are due as scans or readable
photographs of handwritten
Modeling English Propositions 5
The number x is less than y or z.
Mathematics for Computing
COMP SCI 1FC3
McMaster University, Winter 2013
Wolfram Kahl
[email protected]
16 January 2013
Plan for Today
Organisation
(C ALC C HECK)
Office hour:
Moved to:
McMaster University
Department of Computing and Software
Dr. W. Kahl
COMP SCI 1FC3
Sheet 6
COMP SCI 1FC3 Mathematics for Computing
31 January 2013
Solutions to all Asssignmant Questions on this sheet are due as a single PDF document constructed from scans
Formalise:
Formalise!
Every year that is exactly divisible by four is a leap year, except
for years that are exactly divisible by 100; the centurial years
that are exactly divisible by 400 are still leap years. For example,
the year 1900 is not a leap yea
Anything Wrong?
v (S (T U )
=
hSet difference (11.22)i
v Sv
/ (T U )
=
hIntersection (11.21)i
v S (v
/ Tv
/ U)
=
hDistributivity of over i
(v S v
/ T ) (v S v
/ U)
=
hIntersection (11.21)i
(v S v
/ T ) (v S v
/ U)
=
hSet difference (11.22)i
(v (S T