[SOLVED] ICS Problem sheet 3

30.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon Sheet-3-iwmd0v.zip (2511.3 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
Rate this product
Problem 3.1: cartesian products

Prove or disprove the following two propositions:

a)    (A ∩ B) × (C ∩ D) = (A × C) ∩ (B × D)

b)    (A ∪ B) × (C ∪ D) = (A × C) ∪ (B × D)

 
Problem 3.2: reflexive, symmetric, transitive  

For each of the following relations, determine whether they are reflexive, symmetric, or transitive. Provide a reasoning.

  1. The absolute difference of the integer numbers a and b is less than or equal to 3.
    • = {(a,b)|a,b ∈ Z ∧ |a − b| ≤ 3}
  2. The last digit of the decimal representation of the integer numbers a and b is the same.
    • = {(a,b)|a,b ∈ Z ∧ (a mod 10) = (b mod 10)}

Problem 3.3: total, injective, surjective, bijective functions

Are the following functions total, injective, surjective, or bijective? Expain why or why not.

  1. f : N 7→ N with f(x) = 2x2
  2. f : R 7→ R with f(x) = x2 + 6

Problem 3.4: function composition

Given the functions f(x) = x + 1. g(x) = 2x, and h(x) = x2, determine an expression for the following function compositions:

  1. f ◦ g
  2. f ◦ h
  3. g ◦ f
  4. g ◦ h
  5. h ◦ f
  6. h ◦ g
  7. f ◦ (g ◦ h)
  8. h ◦ (g ◦ f)

Problem 3.5: list comprehensions (haskell)

Your list comprehensions should be correct, they do not have to be efficient. You are not getting points for a list comprehension simply returning a hard coded solution list. In other words, your list comprehensions should continue to function correctly if parameters are changed.

  1. Write a list comprehension that returns all positive factors of the number 210. Try to write the list comprehension in such a way that 210 can easily be replaced by a different number.
  2. Write a list comprehension that returns a list of Pythagorean triads (a,b,c), where a,b,c are positive integers in the range 1..100 and the Pythagorean triad is defined as a2 + b2 = c2. The list should not contain any “duplicates” where a and b are swapped. If the list contains (3,4,5) (since 32 + 42 = 25 = 52), then is should not also include (4,3,5).
  • Sheet-3-iwmd0v.zip