[Solved] ICS Problem sheet 3

$25

File Name: ICS_Problem_sheet_3.zip
File Size: 178.98 KB

SKU: [Solved] ICS Problem sheet 3 Category: Tag:
5/5 - (1 vote)
Problem 3.1: cartesian productsProve 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).

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] ICS Problem sheet 3[Solved] ICS Problem sheet 3
$25