**Let p, q, and r be the propositions: p = "the flag is set" q = "I = 0" r = "subroutine S is completed" Translate each of the following propositions into symbols, using the letters p, q, r and logical connectives. (i) If the flag is set, then I = 0 [2 marks] (ii) The flag is set and I = 0 if subroutine S is not completed [2 marks] (iii) Subroutine S is completed if and only if I = 0 and flag is set [2 marks] b) State the converse, contrapositive, and inverse of each of these conditional statements. (i) If it snows tonight, then I will stay at home [3 marks] (ii) I go to the beach whenever it is a sunny summer day [3 marks] (iii) When I stay up late, it is necessary that I sleep until noon [3 marks] c) Explain the step-by-step procedure involved in finding the inverse of an n by n square matrix.**

The **Answer to the Question**

is below this banner.

**Here's the Solution to this Question**

i)

$p\to q$

ii)

$\neg r \to (p\land q)$

iii)

$r\iff (q\land p)$

b)

i)

Converse: If I stay at home, then it will snow tonight.

Inverse: If it does not snow tonight, then I will not stay at home.

Contrapositive: If I does not stay at home, then it will not snow tonight.

ii)

Converse: it is a sunny summer day whenever I go to the beach.

Inverse: I do not go to the beach whenever it is not a sunny summer day.

Contrapositive: It is not a sunny summer day whenever I do not go to the beach.

iii)

Converse: When it is necessary that I sleep until noon, I stay up late.

Inverse: When I do not stay up late, it is not necessary that I sleep until noon.

Contrapositive: When it is not necessary that I sleep until noon, I do not stay up late.

c)

The inverse of a matrix:

$A^{-1}=\frac{adj A}{|A|}$

where adj A is the adjoint matrix and |A| is the determinant of A.

The adjoint of a matrix A is found in stages:

1) Find the transpose of A, which is denoted by AT . The transpose is found by interchanging the rows and columns of A. So, for example, the first column of A is the first row of the transposed matrix; the second column of A is the second row of the transposed matrix, and so on.

(2) The minor of any element is found by covering up the elements in its row and column and finding the determinant of the remaining matrix. By replacing each element of AT by its minor, we can write down a matrix of minors of AT .

(3) The cofactor of any element is found by taking its minor and imposing a place sign according to the following rule

$\begin{pmatrix} + & -&+&... \\ - & +&-&... \\ + & -&+&... \\ ... & ...&...&... \\ \end{pmatrix}$