Logic and proofs(1/5)
proposition 命題
講述的就是邏輯,只有真跟假。不會有模稜兩可的答案,或是沒有答案的。
compound proposition
兩個命題組合起來(且,或)
proposition variable
p, q, r, s
在使用變數的時候,是要嚴謹的去定義,要講清楚,Let p be ....
Logical operators
negation
conjunction
disjunction
exclusive
conditional
biconditional
p -> q (conditional)
(1) if p then q
(2) only if
假設成真,p為q的充分條件,q為p的必要條件在進一步說p 為滿足q的條件之一,但不是滿足了就一定發生;而q發生了,p必然會發生整個命題才會成成真。
1. 故事一
算命師跟A, B, C, D說你們遇到東方人就會賺大錢。不準賠錢。
A跑回去找算命師說我遇到東方人了但我沒賺大錢,算命師說那我算的不準還你錢。 --> 唯一為false
B跑回去找算命師說我遇到東方人了也賺大錢了。
C跑回去找算命師說我沒賺到錢,於是算命師問那你有沒有碰到東方人,C說沒有,算命師回我是說要遇到東方人所以我沒算不準。
D跑回去找算命師說我沒遇到東方人我遇到北方人,但我賺到錢了,你算的不準。算命師回說那我也沒說你遇到北方人不會賺大錢阿。
2. 故事二
我說下雨室外籃球場地會濕。
狀況一下雨了地濕
狀況二下雨了地沒濕 --> 唯一為false
狀況三沒下雨地也沒濕
狀況四沒下雨了地濕了 --> 我沒有說地濕了一定是因為下雨。
3. p --> q 邏輯等價 ~q --> ~p 邏輯等價 ~p + q
You cannot ride the roller coaster if you are under 4 feet tall unless you are older then 16 years old
let q = You cannot ride the roller coaster
let r = you are under 4 feet tall
let s = you are older then 16 years old
(r and ~s) --> q 邏輯等價 ~r or s --> ~q ....Demorgan's law
Logic puzzles
There are two kinds of inhabitants in an is land , knight and knaves, knights always tell the true, and knaves always lie.
A: B is a knight.
B: both of then are opposite types.
Last updated
Was this helpful?