Download presentation
Presentation is loading. Please wait.
1
Functions-Exercises
2
SavingAccs = { (Bill, 123), (Lisa, 145), (Harry, 156), (Sue, 159),
Exercises Given the sets : A = { (1,2), (2,3), (3,7), (7,1) } B = { (1,2), (2,3), (3,7), (7,1), (1,5) } C = { (1,2), (2,2), (3,2), (7,2) } D = { (1,2), (2,2,), (3,2), (7, 2), (1,2) } E = { ( (1,2), (2,3) ), ( (3,7), (7,1) ) } SavingAccs = { (Bill, 123), (Lisa, 145), (Harry, 156), (Sue, 159), (Eve, 154) } 1. Which of the above sets are functions? 2. Write down the domain and range of a. A b. B c. E d. SavingsAccs 3. Write down the values of a. A(3) b. C(2) c. D(7) d. E( (1,2) ) e. A-1(1) f. C-1(2) g. D-1(4) h. E-1( (7,1) ) i. SavingsAccs(Sue) j. SavingsAccs-1(156) k. (A D)(7) l. (C A)(3)
3
Exercises 4. Evaluate a. (C o A)(1) b. (D o C)(7) c. (A o D)(2)
5. If X = { x N | x < 10 } we can see from the given sets above that A X X. We can consider A as a variable and A is given a type in a similar way to a variable in Java. Use relations and functions to model (I.e. describe) the simple banking systems introduced in the weeks 3 and 4 exercises. Give the type definition of each set.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.