Unit 2 of 2 · M.Sc IT Sem 1

Unit 2: Logic and matrices

Mathematics notes · PTU syllabus (PGCA1901)

6 min read10 topics10 exam questions
On this page
  1. Unit summary
  2. Logic statements
  3. Connectives: conjunction, disjunction and negation
  4. Truth tables
  5. Logical equivalence
  6. Tautologies and contradictions
  7. Introduction to matrices
  8. Types of matrices: row, column, rectangular, square, diagonal, scalar, unit, triangular and null
  9. Scalar multiplication, addition and subtraction
  10. Multiplication of matrices
  11. Transpose of a matrix
  12. Key terms
  13. Quick revision
  14. Important questions

Unit summary

Logic underlies program conditions and circuits, and matrices organise data and transformations. This unit covers logic statements and connectives, conjunction, disjunction and negation, logical equivalence, tautologies and contradictions, the types of matrices and matrix algebra — scalar multiplication, addition, subtraction, multiplication and transpose.

After this unit you can

  • Form compound statements with logical connectives
  • Build truth tables and test equivalence
  • Identify tautologies and contradictions
  • Classify matrices and perform matrix operations

PTU syllabus topics

  • Logic statements and connectives
  • basic logic operations (conjunction, disjunction, negation)
  • logical equivalence
  • tautologies and contradictions
  • types of matrices (row, column, rectangular, square, diagonal, scalar, unit, triangular, null)
  • matrix algebra — scalar multiplication
  • addition
  • subtraction
  • multiplication and transpose
ComparisonTruth table for logical connectives
p = T, q = F
p = F, q = T

p ∧ q (conjunction)

F

F

p ∨ q (disjunction)

T

T

¬p (negation)

F

T

p → q (implication)

F

T

1

Topic 1

Logic statements

A statement (proposition) is a declarative sentence that is either true or false, but not both. Its truth or falsity is called its truth value (T or F).

  • "Delhi is the capital of India." — a statement (true).
  • "5 + 3 = 9." — a statement (false).
  • "Close the door." / "What is your name?" / "x + 2 = 5" — not statements: commands, questions and open sentences have no fixed truth value.

Statements are written with small letters p, q, r. A simple statement has one idea; a compound statement joins two or more simple statements using connectives.

Exam tip

Questions, exclamations, commands and sentences containing a variable are not statements. Mention this in any definition answer.

2

Topic 2

Connectives: conjunction, disjunction and negation

ComparisonThe main connectives
Symbol
Read as

Negation

¬p (or ~p)

not p

Conjunction

p ∧ q

p and q

Disjunction

p ∨ q

p or q

Conditional

p → q

if p then q

Biconditional

p ↔ q

p if and only if q

  • Negation (¬p): reverses the truth value. If p is true, ¬p is false.
  • Conjunction (p ∧ q): true only when both p and q are true.
  • Disjunction (p ∨ q): true when at least one of p or q is true; false only when both are false.
  • Conditional (p → q): false only when p is true and q is false.
  • Biconditional (p ↔ q): true when p and q have the same truth value.
3

Topic 3

Truth tables

A truth table lists the truth value of a compound statement for every combination of truth values of its parts. With n simple statements there are 2ⁿ rows.

pq¬pp ∧ qp ∨ qp → qp ↔ q
TTFTTTT
TFFFTFF
FTTFTTF
FFTFFTT

Example

Let p: "It is raining" and q: "I carry an umbrella". p → q ("If it rains, I carry an umbrella") is broken only when it rains and I don't carry one — row 2.

4

Topic 4

Logical equivalence

Two statements are logically equivalent (written ≡) if they have identical truth values in every row of their truth tables. Important equivalences:

  • Double negation: ¬(¬p) ≡ p
  • De Morgan's laws: ¬(p ∧ q) ≡ ¬p ∨ ¬q and ¬(p ∨ q) ≡ ¬p ∧ ¬q
  • Conditional: p → q ≡ ¬p ∨ q
  • Contrapositive: p → q ≡ ¬q → ¬p
  • Biconditional: p ↔ q ≡ (p → q) ∧ (q → p)

Example

To prove ¬(p ∨ q) ≡ ¬p ∧ ¬q, build one truth table with columns p, q, p ∨ q, ¬(p ∨ q), ¬p, ¬q, ¬p ∧ ¬q. The columns for ¬(p ∨ q) and ¬p ∧ ¬q come out identical: F, F, F, T.

Exam tip

When proving equivalence, always write the conclusion: "Since the last two columns are identical, the statements are logically equivalent."

5

Topic 5

Tautologies and contradictions

  • A tautology is a compound statement that is always true, whatever the truth values of its parts. Example: p ∨ ¬p.
  • A contradiction is a statement that is always false. Example: p ∧ ¬p.
  • A statement that is sometimes true and sometimes false is a contingency.
p¬pp ∨ ¬pp ∧ ¬p
TFTF
FTTF

The column p ∨ ¬p is all T (tautology); p ∧ ¬p is all F (contradiction). Note that the negation of a tautology is a contradiction.

6

Topic 6

Introduction to matrices

A matrix is a rectangular array of numbers arranged in rows (horizontal) and columns (vertical), enclosed in brackets. A matrix with m rows and n columns has order m × n. The element in row i and column j is written aᵢⱼ.

Example

A = [2 5 7; 1 0 3] has 2 rows and 3 columns, so its order is 2 × 3, and a₁₃ = 7.

Exam tip

The order is always written as rows × columns. A 2 × 3 matrix has 6 elements.

7

Topic 7

Types of matrices: row, column, rectangular, square, diagonal, scalar, unit, triangular and null

TypeDefinitionExample
Row matrixOnly one row (1 × n)[3 1 4]
Column matrixOnly one column (m × 1)[2; 5; 9]
Rectangular matrixRows ≠ columns2 × 3 matrix
Square matrixRows = columns3 × 3 matrix
Diagonal matrixSquare; all non-diagonal elements are 0[4 0; 0 7]
Scalar matrixDiagonal matrix with all diagonal elements equal[5 0; 0 5]
Unit (identity) matrixScalar matrix with diagonal elements 1, written I[1 0; 0 1]
Null (zero) matrixEvery element is 0, written O[0 0; 0 0]
  • Comparable matrices have the same order.
  • Equal matrices have the same order and equal corresponding elements.

Exam tip

Every unit matrix is a scalar matrix, and every scalar matrix is a diagonal matrix — but not the other way round.

8

Topic 8

Scalar multiplication, addition and subtraction

  • Scalar multiplication: multiply every element by the number k. If A = [1 2; 3 4], then 3A = [3 6; 9 12].
  • Negative of a matrix: −A = (−1)A, so every element changes sign.
  • Addition and subtraction: only for matrices of the same order; add or subtract corresponding elements.

Example

A = [2 3; 1 4], B = [5 1; 0 2]. A + B = [7 4; 1 6] and A − B = [−3 2; 1 2].

Properties of addition: A + B = B + A (commutative), (A + B) + C = A + (B + C) (associative), A + O = A, and A + (−A) = O.

9

Topic 9

Multiplication of matrices

The product AB is defined only when the number of columns of A equals the number of rows of B. If A is m × n and B is n × p, then AB is m × p.

ProcessHow to multiply two matrices
  1. 1Check orders

    Columns of A must equal rows of B

  2. 2Pick row i of A
  3. 3Pick column j of B
  4. 4Multiply pairwise and add

    This gives element (i, j) of AB

  5. 5Repeat for every row and column

Example

A = [1 2; 3 4], B = [5 6; 7 8]. AB = [1·5 + 2·7 1·6 + 2·8; 3·5 + 4·7 3·6 + 4·8] = [19 22; 43 50].

  • Matrix multiplication is not commutative: in general AB ≠ BA.
  • It is associative: (AB)C = A(BC), and distributive: A(B + C) = AB + AC.
  • AI = IA = A for the identity matrix I.

Exam tip

Always write "Since A is m × n and B is n × p, AB exists and is of order m × p" before multiplying. Examiners give marks for it.

10

Topic 10

Transpose of a matrix

The transpose of A, written Aᵀ or A', is obtained by changing rows into columns. If A is m × n, Aᵀ is n × m.

Example

A = [1 2 3; 4 5 6] (2 × 3). Aᵀ = [1 4; 2 5; 3 6] (3 × 2).

Properties:

  • (Aᵀ)ᵀ = A
  • (A + B)ᵀ = Aᵀ + Bᵀ
  • (kA)ᵀ = kAᵀ
  • (AB)ᵀ = BᵀAᵀ (note the reversed order)
  • A square matrix is symmetric if Aᵀ = A and skew-symmetric if Aᵀ = −A.

Key terms

Statement
Sentence that is either true or false
Conjunction
Compound statement with "and", true only when both parts are true
Tautology
Statement true for every truth value of its parts
Square matrix
Matrix with equal numbers of rows and columns
Transpose
Matrix obtained by interchanging rows and columns

Quick revision

  • Statements; connectives ∧, ∨, ¬, →, ↔.
  • Truth tables; logical equivalence; De Morgan's laws.
  • Tautology (always true), contradiction (always false).
  • Matrix types: row, column, rectangular, square, diagonal, scalar, unit, triangular, null.
  • kA, A + B, A − B, AB (columns of A = rows of B), Aᵀ; (AB)ᵀ = BᵀAᵀ.

Important exam questions

Practice questions written to the PTU exam pattern for this unit's syllabus: short answers (Section A style) and long answers (Sections B and C style).

Short-answer questions

  1. Q1.Which of these is a statement: "Close the door" or "7 is prime"?
  2. Q2.Write the truth table of p ∧ q.
  3. Q3.Show that p ∨ ¬p is a tautology.
  4. Q4.Distinguish a scalar matrix and a unit matrix.
  5. Q5.When can two matrices be multiplied?
  6. Q6.Find the transpose of a 2 × 3 matrix.

Long-answer questions

  1. Q1.Explain logical connectives with truth tables.
  2. Q2.Prove a logical equivalence using truth tables.
  3. Q3.Explain the types of matrices with examples.
  4. Q4.Find AB and BA for given matrices and verify (AB)ᵀ = BᵀAᵀ.

Stuck on this unit?

Message SBS on WhatsApp for help with Mathematics, or to ask about studying M.Sc IT at Synetic.

WhatsApp us