Docsity

Past Exam - Data Structures and Algorithms | CS 361L, Exams of Computer Science

Toggle sidebar
bg1
CS 361, Pretest
Prof. Jared Saia, University of New Mexico
January 20, 2003, Due: Tuesday, January 27
This is a take-home “pretest” to test your math background for this
course. It will be graded! However, if you don’t see an answer to a question,
you are free to ask a friend for help, or use a book or the web as a resource.
Please show all your work.
Graded Problems:
1. Find the solutions to this equation: x2−3x−10 = 0.
2. Find the solutions to this equation x2−x−1 = 0
3. Assume that x−y= 2 and x+ 2y= 8 for unknown variables xand
y. What are the values of xand y?
4. Assume you know that some function fis of the form f(x) = ax2+bx,
where the coefficients aand bare unknown. Assume further that
f(1) = 2 and f(2) = 10. What are the coefficients aand b?
5. For each of the following equations, say whether it is always true, or
if it may be false. If the equation is always true, say why. If it’s
false, give values for which it is false. All logs are base 2 unless stated
otherwise.
(a) 2log n=n
(b) alog b=blog a.
(c) log 4x= log 4 + log x
(d) log x2= 2log x
(e) log8x= (log2x)/4 (that is, log base 8 of xis log base 2 of x
divided by 4.
6. What is P∞
i=0 2−i= 1 + 1/2 + 1/4 + 1/8 + ...
1
pf2

Partial preview of the text

Download Past Exam - Data Structures and Algorithms | CS 361L and more Exams Computer Science in PDF only on Docsity!

CS 361, Pretest

Prof. Jared Saia, University of New Mexico

January 20, 2003, Due: Tuesday, January 27

This is a take-home “pretest” to test your math background for this course. It will be graded! However, if you don’t see an answer to a question, you are free to ask a friend for help, or use a book or the web as a resource. Please show all your work. Graded Problems:

  1. Find the solutions to this equation: x^2 − 3 x − 10 = 0.
  2. Find the solutions to this equation x^2 − x − 1 = 0
  3. Assume that x − y = 2 and x + 2y = 8 for unknown variables x and y. What are the values of x and y?
  4. Assume you know that some function f is of the form f (x) = ax^2 + bx, where the coefficients a and b are unknown. Assume further that f (1) = 2 and f (2) = 10. What are the coefficients a and b?
  5. For each of the following equations, say whether it is always true, or if it may be false. If the equation is always true, say why. If it’s false, give values for which it is false. All logs are base 2 unless stated otherwise.

(a) 2log^ n^ = n (b) alog^ b^ = b log^ a. (c) log 4x = log 4 + log x (d) log x^2 = 2 log x (e) log 8 x = (log 2 x)/4 (that is, log base 8 of x is log base 2 of x divided by 4.

  1. What is

i=0 2

−i (^) = 1 + 1/2 + 1/4 + 1/8 +...

  1. Prove, by induction on n, that

∑n i=1 i^ = 1+2+3+· · ·+n^ =^ n(n+1)/2.

  1. Prove, by induction on n, that

∑n i=0 2

i (^) = 2n+1 (^) − 1

  1. Let’s say you have 2 blue blocks, and 2 green blocks, and 1 red block that are otherwise indistinguishable. How many different columns of height 5 can be built from these 5 blocks? For this problem, BRBGG and GGBRB will be considered to be two different columns (i.e. there is a bottom up ordering).

Ungraded Questions:

  1. What is your full current email address?
  2. Circle the algorithms and data structures that you could code in a language of your choice:

Mergesort Quicksort Linked List Binary Tree Heap