Question
QUESTION 1 Write down a set A of three people who are studying at UWA. One of the people in the set should be yourself.
QUESTION 1
Write down a set A of three people who are studying at UWA. One of the people in the set should be yourself. Write down a set B of four food items.
(a) (i) Design a relation R from the set A to the set B. The relation should contain at least three elements. Give your relation as a chart.
(ii) Design a relation S from the set B to itself. The relation should contain at least three elements. Give your relation using infix notation.
(b) (i) Draw an arrow diagram of the composition S R which shows the intermediate arrow diagrams of R and S. (E.g., Lecture 6 slide 24).
(ii) Write down the composition S R using ordered pair notation.
(c) (i) Decide whether your relation S is reflexive, symmetric or transitive. Explain your answers to each part. I.e., if the answer is no, find specific elements which do not satisfy the property, and if the answer is yes, explain how you know the answer is yes.
(ii) Is your relation S an equivalence relation? Explain your answer.
(d) Is your relation R a function? Explain your answer.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
QUESTION 2
A hash function is a way of taking a character string of any length, and creating an output of fixed length. This creates a 'fingerprint' of the character string. Hash functions usually use modular arithmetic to create a fixed length output. Choose a character string that is between 7 and 12 characters long (including spaces). For example. "Julia 123" or "PasSw0rd!".
(a) (i) Write down the decimal ASCII values of each character in your string. We will denote these characters by 1, 2, , where is the length of your string.
(ii) Compute the output of the function () = 1 + 32 + 3 + 34 + .
(iii) Choose another character string that differs from by a single character, and repeat parts (i) and (ii) to compute ().
(b) Choose a modulus m of between 11 and 29 inclusive.
Calculate the least residues modulo m of h(s) and h(t) (i.e. your answers to (a)(ii) and (a)(iii)), showing full working.
(c) When using hash functions in cryptography it is desirable for them to have the property that similar inputs create very different outputs. Using your answers to (b), discuss whether the hash function () mod is a good function to use in cryptography or not.
(d) Give one reason why it might be useful to create hash functions like these as a way of storing passwords in a database.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started