Lessons 1–2 · 2 lessons · M. R. Fayziyeva, D. M. Sayfurov, N. S. Xaytullayeva. Informatics and Information Technologies, Grade 9. “Nashriyot uyi Tasvir”, Tashkent, 2020
2
Logical operations and expressions
Textbook: pp. 6–9
GoalKnows the five basic logical operations (∧, ∨, ¬, =>, <=>), writes their truth tables and evaluates expressions in the right order.
New words
conjunction (AND, ∧, &): true only when both statements are true · konyunksiyadisjunction (OR, ∨): true when at least one statement is true · dizyunksiyainversion, negation (NOT, ¬): swaps true and false · inversiyaimplication (A => B, “if A then B”): false only when A is true and B is false · implikatsiya
Explanation
Logical operations build new statements from old ones. Conjunction (A ∧ B, “and”) is true only when both statements are true; disjunction (A ∨ B, “or”) is true when at least one is true; inversion (¬A, “not”) turns the value into its opposite. Implication (A => B, “if A, then B”) is false only when A = 1 and B = 0; equivalence (A <=> B) is true when A and B have the same value. In the tables the pair (A, B) is written in the order 00, 01, 10, 11: the result for ∧ is 0, 0, 0, 1; for ∨ it is 0, 1, 1, 1; for => it is 1, 1, 0, 1; for <=> it is 1, 0, 0, 1. In an expression the operations are done in this order: ¬, ∧, ∨, =>, <=>; brackets come first and operations of the same level go left to right. The textbook also writes ⏋A for ¬A and A & B for A ∧ B.
Worked examples
Let A = 0, B = 1, C = 0. Evaluate A ∨ B ∧ C: first ∧: B ∧ C = 1 ∧ 0 = 0; then ∨: A ∨ 0 = 0 ∨ 0 = 0. Result: 0.
Write “If it rains or snows, I take an umbrella”: A = “It rains”, B = “It snows”, C = “I take an umbrella”. Expression: (A ∨ B) => C. ∨ is done before => anyway; the brackets just make the expression easier to read.
Class activity
“Living table”: four students hold up the values of A and B (0 or 1) on cards while the others show the result of a chosen operation (e.g. =>); the four cases 00, 01, 10, 11 are repeated in turn.
Practice
1
For A = 1, B = 0 find A ∧ B, A ∨ B, ¬A, A => B, A <=> B.
0, 1, 0, 0, 0
2
For A = 1, B = 0, what is ¬A ∨ B ∧ A?
¬A = 0; B ∧ A = 0; 0 ∨ 0 = 0. Answer: 0.
3
Write “If I take a book and a notebook, my bag will be heavy” as a logical expression (A – book, B – notebook, C – bag heavy).
(A ∧ B) => C
4
Why is A => B false only when A = 1 and B = 0?
If the condition (A) holds but the result (B) does not, the promise is broken. If A = 0 the promise demands nothing, so the expression is not false.