Propositions and Boolean Formulæ

(命題と論理式)

Discrete Mathematics I

3rd lecture, October 4, 2019

https://www.sw.it.aoyama.ac.jp/2019/Math1/lecture3.html

Martin J. Dürst

AGU

© 2005-19 Martin J. Dürst Aoyama Gakuin University

Today's Schedule

 

Summary of Last Lecture

 

Last Week's Homework: Jokes

Question: Why do computer scientist always think Christmas and Halloween are the same?

[Sorry, removed!]

Question: At what age do Information Technologists celebrate "Kanreki" (還暦)

64 = 26 ("Kanreki" is a round number in the East Asian calendar. For Information Technology, powers of 2 are round numbers.)

 

Last Week's Homework: Arithmetic and Base Conversion

 

About Moodle

Those who have not yet registered for "Discrete Mathematics I" at http://moo.sw.it.aoyama.ac.jp, and those who have their name in Romaji instead of Kanji, must come to the front immediately after this lecture

[まだ http://moo.sw.it.aoyama.ac.jp で授業登録できてない人 、又は漢字ではなくローマ字で名前を登録している人は必ず授業直後申し出ること!]

 

How to Watch Videos

The video of the first two lectures are available via a link from Moodle.

Userid and password are the same as for other Aoyama websites.

Please use the video soon to review the lecture.
Please be careful when watching the video on a mobile device (may be expensive!).

The video can be watched at different speeds, and you can jump easily to the next slide.

 

Proposition

 

Counterexamples of Propositions

The following are NOT propositions:

Counterexamples (NOT propositions):

 

Truth Values of a Proposition

 

Truth Values in Program Languages

Different programming languages handle truth values differently.

Some examples:

 

Logical Operations

With logical operations, we can create compound propositions from simpler propositions.

The most frequently used, and most basic, logical operations are:

 

Overview of Conjunction (and)

Based on two propositions A and B, we can construct the following proposition:

A and B

We write AB (also: A·B, A B, AND(A, B))

Because ∧ has two operands, it is a binary operation.

AB is defined as follows:
If both A and B are true, then AB is true.
Else, AB is false.

 

Truth Table for Logical And

A B AB
F F F
F T F
T F F
T T T

Because there are only two truth values, we can define logical operations using a table. This is similar to the 9×9 multiplication table,

but would not work for operations on integers (e.g. multiplication) in general.

 

Examples for Logical And

7 is smaller than 5 ∧ 7 is even (read: 7 is smaller than 5 and is even): F

8 is smaller than 5 ∧ 8 is even (read: 8 is smaller than 5 and is even): F

4 is smaller than 5 ∧ 4 is even (read: 4 is smaller than 5 and is even): T

3 is smaller than 5 ∧ 3 is even (read: 3 is smaller than 5 and is even): F

 

Overview of Disjunction (or)

Based on two propositions A and B, we can construct the following proposition:

A or B

A or B is written AB (also: A+B, OR(A, B))

AB is defined as follows:
If both A and B are false, then AB is false.
Else, AB is true.

This means that logical or is inclusive. Logical or is a binary operation.

 

Truth Table for Logical Or

A B AB
F F F
F T T
T F T
T T T

 

Examples for Logical Or

4 is smaller than 5 ∨ 4 is even: T

8 is smaller than 5 ∨ 8 is even: T

7 is smaller than 5 ∨ 7 is even: F

3 is smaller than 5 ∨ 3 is even: T

 

Overview of Negation (not)

Based on one proposition A, we can construct the following proposition:

not A

not A is written ¬A (also A', A, ~A, NOT(A)).

¬A is true if A is false

¬A is false if A is true.

Negation has only one operand and is therefore a unary operation.

 

Truth Table for Logical Not

A ¬A
F T
T F

 

Examples for Logical Not

¬ (4 is even) (read: 4 is not even): F
¬ (4 is odd) (read: 4 is not odd): T

 

The Importance of Logical Operations

In Information Technology:

In Mathematics:

 

Modeling

Examples: Conditions for getting a discount; conditions for a passing grade in a course; conditions for completing (winning) a game,...

 

Modeling Example

Condition for getting a discount: You get a discount if you are a student of Aoyama Gakuin University and today is a Friday or a Saturday.

Propositions:

Ao: You are a student of Aoyama Gakuin University.

Fr: Today (October 4, 2019) is a Friday.

Sa: Today (October 4, 2019) is a Saturday.

The truth values for these propositions are: Ao=T, Fr=T, Sa=F

The condition for a discount can be expressed as:
Ao ∧ (FrSa)

The condition evaluates to T, so you get a discount!

 

Structure of Logical Formulæ

We can creat a logical formula from propositions, propositional variables, and logical operators.

Example: (A ∨ (¬B)) ∧ C

Operator precedence and omission of parentheses:

Precedence for logical operators:

Examples:
ABC = A ∨ (BC) ≠ (AB) ∧ C
(A ∨ (¬B)) ∧ C = (A ∨ ¬B) ∧ CA ∨ ¬BC

 

Well-Formed Formula

(WFF)

Goal: Make the structure (grammar) of logical formulæ clear.

All of the following are well-formed formulæ

Formulæ that do not fit the above definition are not well-formed formulæ.
(Attention: In a later lecture, we will introduce more logical operators. This will extend the definition.)

Examples:
(A¬B) ∧ C (well-formed)
(A ∨(B ¬∧) C (not well-formed)

 

Formulæ as Trees

 

Example of Formula as a Tree

Example formula: A¬BC

Logical Formula Evaluation with a Truth Table

Truth tables are often used to:

Example formula: (A ∨ ¬B) ∧ B

Evaluation using a truth table

A B ¬B A ∨ ¬B (A ∨ ¬B) ∧ B
F F T T F
F T F F F
T F T T F
T T F T T

From this truth table, we can deduce that (A ∨ ¬B) ∧ B = AB

 

How to Write a Truth Table

 
 
 
 
 
 
 

 

Boolean Functions

 

Number of Boolean Functions for n Variables

Question: Can we find a logic formula for any such function? (Answer: see next lecture)

 

Simple Laws for Arithmetic Operations

(for integers or reals,...)

 

Simple Laws for Logical Operations

 

This Week's Homework

Repeat each quiz until you get 100% correct answers; deadline: October 10 (Thursday) 22:00:

  1. Solve the quiz Propositions: True or False
  2. Solve the quiz Truth Table 1
  3. Solve the quiz Truth Table 2
  4. Use highschool texts or the Web to research about other laws for logical operations.

 

今回の宿題

下記のクイズは満点まで繰り返す; 締切: 10月10日 (木) 22:00:

  1. Moodle で Propositions: True or False のクイズを解く
  2. Moodle で Truth Table 1 のクイズを解く
  3. Moodle で Truth Table 2 のクイズを解く
  4. 論理演算の (交換律、結合律、分配率以外の) 法則について高校の資料やウェブで調べること。

 

Glossary

round number
切りのいい数
proposition
命題
objective (adj.)
客観的
subjective (adj.)
主観的
opinion
意見
variable
変数
pronoun
代名詞
odd number
奇数
even number
偶数
truth value (of a proposition)
(命題の) 真偽
true
真 (しん)
false
偽 (ぎ)
type (in programming languages)
(プログラム言語の) 型
logical operation
論理演算
electronic circuits
電子回路
reasoning
推理、推論
modeling
モデル化 (する)
(logical) and
かつ
binary operation
二項演算
unary operation
単項演算
conjunction
論理積
truth table
真理表 (又は真理値表)
logical operation
論理演算
compound proposition
複合命題
(logical) or
又は
disjunction
論理和
(logical) not
ではない
negation
論理否定
logical formula
論理式 (複数: formulæ or formulas)
well-formed (logical) formula
整論理式
grammar
文法
tree
木 (生物学のものではなく、数学や情報テクノロジーで使うもの)
root
(木の) 根
internal node
内部節
leaf
propositional variable
命題変数
(operator) precedence
(演算子の) 優先順位
evaluation
(式の) 評価
parentheses
括弧
subexpression
部分式
Boolean function
論理関数、ブール関数
Boolean argument
論理引数 (ひきすう; ブール引数とも言う)
domain (of a function)
(関数の) 定義域
range (of a function)
(関数の) 値域
commutative law
交換律
distributive law
分配律
distribute
分配する