Key Concepts in Computer Science – Assignment 1
1. [1 mark] What is Log4(1024)? Show how you determine the result.
ππππ= ππ
Log4(1024) = ππ¨π π(ππ)=πΒ· ππ¨π π(π) = 5
2. [2 marks] Given ππ¨π π(π)=π solve for x. Show how you determine the result.
ππ¨π π(π)=π βΉ ππ=π βΉπ=ππ This is derived from the definition of logarithm.
3. [3 marks] Find the tightest integer upper bound and lower bound for x if π= ππ¨π π(ππ). Justify your answer.
ππ<ππ< ππ βΉ ππ< ππ< ππ βΉ ππ¨π π(ππ)< ππ¨π π(ππ)< ππ¨π π(ππ) βΉπ< ππ¨π π(ππ)< 5 βΉ π<π < 5
4. [2 marks] For question 3, write the upper bound and lower bound of x using interval notation.
x β (4,5)
5. [2 marks] Find answer for the following floor and ceiling functions.
β12.3β = 12
β-78.999β = -78
β-0.0001β = -1
β10001.001β = 10001
6. [3 marks] Solve for x if 2×2-3x-2 = 0 using the formula for the roots of a quadratic equation.
ax2 + bx + c = 0
x = βb Β± βb2 – 4ac2a
a = 2, b = -3, c = -2
x = β(β3) Β± β(β3)2 – (4Γ2Γ(-2))2Γ2= 3 Β± β9 + 164= 3 Β± β254= 3 Β± 54
x = 2 and x = -0.5 (note: x has two values)
7. [3 marks] Solve this inequality 12 < -2x + 4 and write it using interval notations for x.
12 < -2x + 4 βΉ 8 < -2x βΉ -4 > x
x β (-β, -4)
8. [4 marks] Prove the following equation: ππ¨π π(ππ)=ππ¨π π(π)β ππ¨π π(π).
Assume b > 0, b β 1, x>0, y>0
(1) Let m = Logb(x) and n = Logb(y)
(2) Then x = bm and y = bn
(3) π₯π¦ = ππππ
(4) π₯π¦ = bm-n
(5) Logb(π₯π¦) = Logb(bm-n)
(6) Logb(π₯π¦) = (m – n)Β·Logb(b)
(7) Logb(π₯π¦) = m – n
(8) Logb(π₯π¦) = Logb(x) – Logb(y)
Leave a reply