# Mathematics

#### Mathematics

Referencing Styles : Not Selected | Pages : 18

Consider the functions f, g and h, all defined on the set 0, 1, 2, 3, …, 12

x

0

1

2

3

4

5

6

7

8

9

10

11

12

f(x)

0

1

6

9

10

5

2

11

8

3

4

7

12

x

0

1

2

3

4

5

6

7

8

9

10

11

12

g(x)

0

1

5

1

12

5

5

8

8

1

12

8

12

x

0

1

2

3

4

5

6

7

8

9

10

11

12

h(x)

0

1

11

3

4

8

7

6

5

9

10

2

12

(i) Write down the values of: f(g(h(10))) and f –1(h–1(6))

(ii) Construct a table of values (like those shown above) for g(f –1(x)).

(iii) Construct a table for h(h(x)). What can you conclude about the inverse of h?

(iv) Construct a table for f –1(x), and draw its graph on the grid provided on the last page.

[5 marks]

Question 2

Suppose there is a set of growers G = a, b, c, d, a set of retailers R = e, f, g and a set of customers C = m, n, p, q, r. There are two relations A and B on G ï‚´ R and R ï‚´ C, respectively, defined by:

aAe, bAf, cAe, cAg, dAf, and eBn, eBp, fBm, fBq, gBn, gBr

xAy means “grower x sold goods to retailer y”, and

yA–1x means “retailer y bought goods from grower x”

xBy means “retailer x sold goods to customer y”, and

yB–1x means “customer y bought goods from retailer x”

(i) Find the matrices M(A) and M(B) that represent the relations A and B.

(ii) Find the matrices M(A)T and M(B)T that represent the relations A–1 and B–1

(iii) Consider the query:

Which customers have received goods that came from the same grower(s) as those goods received by customer p?

Find the logical matrix products M(A) M(B) and then M(B)T M(A)T, and finally M(B)T M(A)T M(A) M(B), and hence answer the query.

[ Hint: To see a similar exercise, look at the “Application” on page 13 of Lecture 5.]

ENS1161_A1_PIBT_v15_1_2015 Page 3 of 6

Question 3

(a) Consider the following table:

(i) Convert each of the decimal numbers in the first column to octal.

(ii) Convert the two octal numbers to binary.

(iii) Convert the two binary numbers to hexadecimal.

(v) Convert the hexadecimal sum to binary, then to octal and then to decimal.

(b) (i) Convert the decimal fraction 0.28125 to binary;

(ii) Convert the decimal fraction 0.65625 to binary;

(iii) Add the two binary fractions from (i) and (ii);

(iv) Convert the binary fraction from (iii) to decimal.

(c) Add the following, given that (i) is binary, (ii) is octal and (iii) is hexadecimal:

(i) 1011011 (ii) 6543 (iii) B0A7F

1000111 + 2536 + 3DC28 +

(i) 2787 (ii) 283632

4379 + 165173 +

[5 + 2 + 3 + 2 = 12 marks]

Question 4

For each of the following, suppose that two 8-bit binary numbers have been added. In each case the 8-bit output is given and the values of the N, V and C flags. For each case give the correct answer as a decimal number:

(i) if the result is interpreted as the sum of unsigned integers;

(ii) if the result is interpreted as the sum of signed integers.

[ 10 ï‚´ 1 = 10 marks ]

decimal

octal

binary

83

135

8-bit output

N

V

C

(a)

0010 0010

0

0

1

(b)

1100 1101

1

0

0

(c)

1001 1100

1

0

1

(d)

0111 1011

0

0

0

(e)

0011 0011

0

1

1

[1