[Solved] ICS Problem sheet 2

$25

File Name: ICS_Problem_sheet_2.zip
File Size: 178.98 KB

SKU: [Solved] ICS Problem sheet 2 Category: Tag:
5/5 - (1 vote)
Problem 2.1: proof by contrapositive

Let x and y be real numbers, i.e., x,y R. If y3 + yx2 x3+ xy2, then y x.

Problem 2.2: proof by induction

Let n be a natural number with n 1. Prove that the following holds:

Problem 2.3: operator precedence and associativity (haskell)

Haskell operators have associativity and precedence. The associativity defines in which order operators with the same precedence are evaluated while the precedence defines in which order operators with different precedence levels are evaluated (higher precedence level first).

  1. Some operators are neither left nor right associative. What happens if such operators appear multiple times in an expression (without additional parenthesis defining the evaluation order)? Provide an example and an explanation.
  2. Haskell has a very special operator $. What is the precedence and associativity of this operator? Write the following prefix expression

(^) 2 $ (*) 5 $ (+) 2 3

in infix notation without the $ operator, using parenthesis where necessary

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 2[Solved] ICS Problem sheet 2
$25