Uploaded by Abdulahi Abass

Mathematical Proofs & Algorithm Analysis

advertisement
1. P (n) ⇐⇒ (n > 1) ∧ (∀d (d ̸= n ∧ d ̸= 1) =⇒ (n/d) ∈ Z)
2. (a). Let S be the Statement
∃M > 0, ∀x ∈ R, ((−2x + 16 > 4) ∨ ((x − M )3 > 27))
(1). Let M = 2. We will show that for all real numbers x, ((−2x+16 >
4) ∨ (x − M )3 > 27)
(2). When x < 6, =⇒ −2x < −12, and by adding 16 to both sides, we
arrive at −2x + 16 < 4.
(3). when x ≥ 6, x − M ≥ 4 > 3, and by cubing both sides, we arrive at
(x − M )3 > 27.
(4). Since we have proved when x < 6, −2x + 16 < 4 and when x ≥
6, (x − M )3 > 27, we have proved that for all real numbers x, there exists
an M > 0, such that ((−2x + 16 > 4) ∨ (x − M )3 > 27)
(b). Let T be the statement
∃M > 1, ∀x > 0, ∀y > 0, (x + y > 1 =⇒
1
1
+ < M)
x y
(1). We will prove ¬T , which is the statement
∀M > 1, ∃x > 0, ∀y > 0, (x + y > 1 =⇒
1
1
+ > M)
x y
1
(2). Let M > 1 be arbitrary, and let xy < M
, we will show that
1
1
x + y > 1 =⇒ x + y > M
1
1
1
1
(3). Since xy < M
=⇒ xy
> M , and x + y > 1 =⇒ x+y
xy > xy
x+y
1
1
(4). Since xy
> M and x+y
xy > xy , therefore xy > M
(3). (a).
∃M > 0, ∀n > M, (log2 (n))2 > 999 log2 (n)
(1). Let M = 2999 , we will show that for all n > M , (log2 (n))2 >
999 log2 (n)
(2). Since n > M = 2999 , we can take the log base 2 of both sides to get
log2 (n) > 999
(3). By multiplying both sides of the inequality by log2 (n), we get
(log2 (n))2 > 999 log2 (n)
(b).
∀M > 0, ∃n > 0, (n2 < M (5n5 − 4n2 − 1))
q
M
(1). Let M > 0 be arbitrary, and let n >
9M −1 , we will show that
n2 < M (5n5 − 4n2 − 1)
(2). Since n >
q
M
M
2
9M −1 , we can square both sides to get n > 9M −1 , mul2
tiplying both sides of the inequality by 9M − 1, we get (9M − 1)n > M ,
we can then expand the equation to give 9M n2 − n2 > M , rearranging
the terms give n2 < M (9n2 − 1)
(3). Now to prove M (9n2 − 1) < M (5n5 + 4n2 − 1), we can express this
as M (5n2 + 4n2 − 1) < M (5n5 + 4n2 − 1) for this statement to be true
5n2 < 5n5 must also be true, which is true for all n > 0
2
(4). Since we have proved that n2 < M (9n2 − 1) and M (9n2 − 1) <
M (5n5 + 4n2 − 1), we have proved that for all M > 0, there exists an
n > 0, such that n2 < M (5n5 − 4n2 − 1)
(5). (a).
result ← 0 → 1 step
i ← 1 → 1 step
PA−1
while(i < A.length) 1 + n=0 3
result ← result + A[i]
i←i+1
result ← result/A.length 1 step
return result 1 step
T otal = 1 + 1 + 1 +
A−1
X
3+1+1
i=0
= 5 + 3A
(b).
result ← 0
1 step
i←0
1 step
while (i < A.length)
1+
PA−1
i=0
3
result ← result + pow(A[i] − arithmeticM ean(A), 2)
i←i+1
result ← sqrt(result/A.length)
return
result
1 step
T otal = 1 + 1 + 1 +
A−1
X
i=0
= 5 + 3A
3
1 step
3+1+1
Download