View the step-by-step solution to:

# ENS1161D_A2_v27_ECC_1_2017.doc ENS1161 Computer Fundamentals ASSIGNMENT 2 Trimester 1, 2017 Topics covered: Relations, Functions, Bases and Number...

Hello, I need all answer of this computer science questions.

Thank you.

ENS1161D_A2_v27_ECC_1_2017.doc School of Engineering ©ECU 3/02/2017 ENS1161 Computer Fundamentals ASSIGNMENT 2 Trimester 1, 2017 Topics covered: Relations, Functions, Bases and Number Systems, Computer representation of numbers, BCD addition and ASCII codes. Source material: Lectures 5 to 8 and tutorial exercise sheets are available on Moodle. Marks: 15% of total marks for the unit. The assignment will be marked out of 40 and scaled to a mark out of 15. Due date: Week 10 of semester (see Moodle or lecturer for details). A penalty for late submissions will apply as specified in the handbook. Submission instructions: Please ensure that you submit your assignment in the correct box. (No responsibility will be taken for assignments submitted incorrectly) If you are unsure, check with your lecturer or tutor. Applications for extension: Applications for extension (on medical or other grounds) should be made in writing to the unit coordinator before the due date, and should be accompanied by appropriate evidence (e.g. medical certificate) to support your application. Presentation: You may use a computer package to prepare your submission, but it is not essential. In some cases it may be preferable to put in diagrams and symbolic expressions by hand if you are not competent to produce an acceptable result using a computer package. You should use one side of each sheet only. Plastic covers are not required; in fact they usually complicate the processing of submissions.
ENS1161D_A2_v27_ECC_1_2017.doc Page 2 of 8 Question 1 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 5 10 4 3 1 12 7 11 9 2 8 6 x 0 1 2 3 4 5 6 7 8 9 10 11 12 g(x) 5 4 11 0 6 10 2 7 1 12 9 8 3 x 0 1 2 3 4 5 6 7 8 9 10 11 12 h(x) 3 6 0 10 9 5 2 12 1 7 11 4 8 (i) Write down the values of: g(f(h(7))) and h –1 (g –1 (3)) (ii) Construct a table of values (like those shown above) for h(g –1 (x)). (iii) Construct a table for f(f(x)). What can you conclude about the inverse of f? (iv) Construct a table for h –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: aAf, bAe, bAg, cAg, dAf, and eBn, fBp, fBq, gBm, gBr xAy means "grower x sold goods to retailer y", and yA –1 x means "retailer y bought goods from grower x" xBy means "retailer x sold goods to customer y", and yB –1 x 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.] [1 + 1 + 3 = 5 marks]
Show entire document

Scanned by CamScanner Scanned by CamScanner Scanned by CamScanner Scanned by CamScanner Scanned by CamScanner Scanned by CamScanner Scanned by CamScanner Scanned by CamScanner Scanned by CamScanner

### Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

### -

Educational Resources
• ### -

Study Documents

Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

Browse Documents