练习题1-1:逻辑

1-1 Worksheet Logic

问题一: 命题 (Propositions)

判断下列每个句子是否为命题. 如果是一个命题,说明它的真值,否则解释为什么他不是命题.

(1). Is this a proposition?
(2). 2 + 4 = 7
(3). x + 5 = 6
(4). The School of Computing is part of the Faculty of Engineering and Physical Sciences.
(5). Stop!!

  1. 不是命题,该句子是范围局不是陈述句
  2. 是命题,但等式不成立,真值为false
  3. 不是命题,不能判断真值为true或者false
  4. 是命题,陈述事实,真值为true
  5. 不是命题,该句子不是陈述句

问题二: 使用命题逻辑建模英语句子(Modelling English with propositional logic)

设p, q 和 r 为下列的命题。
p: I score 50% or more in Algorithms.
q: I pass the module.
r: Unicorns exist.

通过使用p, q, r 和逻辑连接词构建符合命题,为下列自然自然语言语句建模:
(1) If I score 50% or more in Algorithms then I pass the module.
(2) I score less than 50% in Algorithms and I pass the module.
(3) Either I score 50% or more in Algorithms or unicorns exist.
(4) It is not the case that unicorns exist therefore I pass the module.
(5) Unicorns exist if and only if I pass the module.

  1. p → q p \rightarrow q pq
  2. ¬ p ∧ q \neg p \wedge q ¬pq
  3. ( p ∨ r ) ∧ ¬ ( p ∧ r ) (p \vee r)\wedge\neg(p\wedge r) (pr)¬(pr)
  4. ¬ r ∧ q \neg r\wedge q ¬rq
  5. r ↔ q r\leftrightarrow q rq

注意:either…or…不包含两者同时成立,使用’并’逻辑操作符时,要去掉同时成立条件。

问题三: 否定(Negation)

找出下列命题的否定形式
(1) At least 10 inches of rain fell today in Leeds.
(2) I score 50% or more in Algorithms and I pass the module.
(3) If Maria studies Algorithms, she will find a good job.
(4) All bicycles are green.
(5) All mountains are at most 8000 metres high.

  1. Less than 10 inches of rain fell today in Leeds.
  2. I score less than 50% in Algorithms or I do not pass the module.
  3. Maria studies Algorithms but she does not find a good job.
  4. At least one bicycle is not green.
  5. There exists a mountain that is more than 8000 metres high.

问题四: 使用逻辑谓词建模英语句子(Modelling English with predicate logic)

使用逻辑谓词为下列自然语言句子建模。记住要定义谓词和定义域。

(1) All students in the class progress into the second year if they pass the exam.
(2) All students will either pass or fail.
(3) There exists a day in the week when I will not work.
(4) There exists a student who will score 100% in every module.
(5) For every natural number x x x, x x x is even if and only if x 2 x^2 x2 is even.

  1. ∀ x ( E ( x ) → P ( x ) ) \forall x(E(x)\rightarrow P(x)) x(E(x)P(x)),这里 x x x 的定义域由班上所有学生组成,并且 E ( x ) E(x) E(x) 表示’x passes the exam’,而且 P ( x ) P(x) P(x)表示’x progesses into the second year’
  2. ∀ x ( P ( x ) ∨ ¬ P ( x ) ) \forall x(P(x)\vee\neg P(x)) x(P(x)¬P(x)),这里 x x x 的定义域由所有学生组成,并且 P ( x ) P(x) P(x)表示’x passes’
  3. ∃ x ¬ W ( x ) \exists x\neg W(x) x¬W(x),这里 x x x 的定义域由包含了所有的工作日,并且 W ( x ) W(x) W(x)表示’I will work on x’
  4. 方法1: ∃ x ( S ( x ) ∧ ∀ y ( M ( y ) → H ( x , y ) ) ) \exists x(S(x)\wedge\forall y(M(y)\rightarrow H(x,y))) x(S(x)y(M(y)H(x,y))),这里 x x x y y y 的定义域由所有人和模块组成, S ( x ) S(x) S(x) 表示’x is a student’, M ( x ) M(x) M(x)表示’x is a module’,并且 H ( x , y ) H(x, y) H(x,y)表示’x scores 100% in y’
    方法2: ∃ x ∀ y H ( x , y ) \exists x\forall y H(x,y) xyH(x,y),这里 x x x 的定义域由所有学生组成, y y y 的定义域由由所有模块组成,并且 H ( x , y ) H(x,y) H(x,y)表示’x scores 100% in y’
    5. ∀ x ( ∃ y ( x = 2 y ) ↔ ∃ z ( x 2 = 2 z ) ) \forall x(\exists y(x=2y)\leftrightarrow\exists z(x^2=2z)) x(y(x=2y)z(x2=2z)),这里 x x x y y y 的定义域为 N N N.

问题五: 将谓词逻辑翻译成英语句子(Translating predicate logic to English)

对下列每个谓词逻辑公式,写一个自然语言句子并且表达相同的含义。
(1). ∀ x ( P ( x ) ∨ ¬ P ( x ) ) \forall x(P(x) \vee \neg P(x)) x(P(x)¬P(x)), 其中 x x x 的定义域是所有人的集合, 并且 P ( x ) : = P(x):= P(x):=‘为Free Software Foundation工作’。

(2). ∃ x ∀ y ( R ( x , y ) ∧ R ( y , x ) ) \exist x\forall y(R(x,y) \wedge R(y,x)) xy(R(x,y)R(y,x)),其中 x x x y y y 的定义域由集合 { A l i c e , B o b , C l i v e , D a v i n a , E d g a r } \{Alice,Bob,Clive,Davina,Edgar\} {Alice,Bob,Clive,Davina,Edgar}组成,并且 R ( x , y ) : = R(x,y):= R(x,y):= x x x knows y y y’。

(3). ( ∀ x ( H ( x ) → M ( x ) ) ∧ H ( A l e x ) ) → M ( A l e x ) (\forall x(H(x)\rightarrow M(x))\wedge H(Alex))\rightarrow M(Alex) (x(H(x)M(x))H(Alex))M(Alex),其中 x x x 的定义域是所有生物的集合, H ( x ) : = H(x):= H(x):= x x x是人类’, M ( x ) : = M(x):= M(x):= x x x是凡人’。

  1. All people either work for the Free Software Foundation or do not work for the Free Software Foundation.
  2. At least one of Alice, Bob, Clive, Davina and Edgar knows and is known by all the others.
  3. If all humans are mortal and Aless is human then Alex is mortal.

问题六: 用命题逻辑建模解决问题(Modelling with propositional logic for problem solving)

有人从饼干罐里偷了饼干。嫌疑人是 A l b e r t , B e t t y Albert, Betty Albert,Betty and C l i v e Clive Clive,至少其中一人犯下了罪行。只有 A b e r t Abert Abert 参与了, C l i v e Clive Clive才会参加, B e t t y Betty Betty 不会独自参加。

(1) 使用下列命题,用命题逻辑建模情景
a: Albert stole the cookies.
b: Betty stole the cookies.
c: Clive stole the cookies.

ϕ = ( a ∨ b ∨ c ) ∧ ( c → a ) ∧ ( b → ( a ∨ c ) ) \phi=(a\vee b\vee c)\wedge(c\rightarrow a)\wedge(b\rightarrow(a\vee c)) ϕ=(abc)(ca)(b(ac))

abca ∨ \vee b ∨ \vee cc → \rightarrow aa ∨ \vee cb → \rightarrow (a ∨ \vee c) ϕ \phi ϕ
TTTTTTTT
TTFTTTTT
TFTTTTTT
TFFTTTTT
FTTTFTTF
FTFTTFFF
FFTTFTTF
FFFFTFTF

(2) A l b e r t Albert Albert 参与了犯罪吗?用你的情景模型解释你的答案。

A l b e r t Albert Albert 参与了犯罪,因为当每个 p h i phi phi为true时, a a a 都为true,可以从上面的真值表得出结果。

(3) B e t t y Betty Betty C l i v e Clive Clive 参与了犯罪吗?用你的情景模型解释你的答案。

我们不知道,他们可能犯罪也可能没犯罪,可以从上面的第二和第三行得出结果。

评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值