AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Contents · Computing

Foundations of logic and logical operations

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.

ABA ∧ BA ∨ BA => BA <=> B
000011
010110
100100
111111
ABXOR1ABF000011101110

F = A XOR B → 1

The A and B buttons flip an input between 0 and 1

💡 Where will I use this?
In real life

The school library has a rule: a pupil may borrow a book if the pupil has a library card or a note from a teacher, and the book is on the shelf. A pupil with a note but no card could still borrow it, because “or” needs only one of the two conditions.

Who uses it

Rule writers, electricians and programmers use “and”, “or” and “not” to state conditions precisely.

Try it today

Take a house or class rule and write it with “and”, “or” and “not”. List on paper the cases when it is allowed.

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.
2
For A = 1, B = 0, what is ¬A ∨ B ∧ A?
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).
4
Why is A => B false only when A = 1 and B = 0?
Story of the Week · The Khwarizmi WayWhich idea do we start with?Close the week: all of this week’s subjects in one storyRead →