Final exam

December 12th, 2008

It’s here ! the dreaded final, in PDF and LaTeX. Due Monday Dec 15 @ 5pm.

50 Responses to “Final exam”

  1. Tilottama Says:

    With the deadline now over, I was wondering how we might get the solutions for homework 6..

  2. admin Says:

    I’m going to email it later tonight

  3. Brent Says:

    On the first question, is the definition of rank just for our information as part of the rest of the definitions, or is it possible to use it to determine the rank of a given x?

  4. admin Says:

    I’m not sure I understand, but I think the notion of rank is merely defined to introduce the notion of an eps-approximate median, which is the thing you need to find. Obviously if you wanted to find the rank of a given x exactly, it would take linear time.

  5. Brent Says:

    Again on question one, does the algorithm have to return an element that is actually in the set, or can it give a value that seems likely to be an epsilon-approximate median?

  6. mark Says:

    On the first question, does our algorithm always need to return a value that is within the given rank bounds, or can it be only expected to return such an answer?

  7. Mike Clark Says:

    Also for 1:

    What are the bounds on epsilon?

  8. admin Says:

    Brent: the algorithm must return an element of the set.
    Mark: please refer to the last bullet on the cover sheet
    Mike: epsilon is an input parameter that is at most 0.5, and is strictly more than zero.

  9. Kenneth Williams Says:

    For 4.a do we need to show an algorithm for getting these sequences, or just show that there exists a sequence for any graph (just prove it)?

  10. admin Says:

    you can do either. If you design an algorithm, then you’re not constrained by the usual running time bounds (polytime etc) for obvious reasons. If you show an existence proof, that’s fine as well.

  11. mark Says:

    On question 2 will all of the queries be integers?

  12. admin Says:

    Not necessarily, but you can ignore issues of word length i.e if the query is not an integer, it still fits in whatever number of bits is allocated to a query variable. You may also assume that standard operations like log, exp, floor, ceiling etc can be performed efficiently (although this can be dangerous in general!)

  13. Questioner Says:

    For problem 1 and 2, is it unordered or ordered?

  14. admin Says:

    I’m not sure I understand the question. In both problems, we’re dealing with an input that must be ordered (otherwise medians and binary search are not even well defined)

  15. John M Says:

    But then why not just take the (n+1)/2 item as the median?

  16. admin Says:

    oh I see. so that was the question. NO, the items are not presented in ordered fashion.

    What I meant in my answer is that there’s an inherent ordering property on the objects (which is what I inferred the earlier question to be asking).

  17. Questioner Says:

    On question 1 when you say “your algorithm running time will not depend on n”, what do you mean? Do you mean that we can’t have n at all in our running time? Or can we show that n essentially doesn’t matter at all in our running time?

  18. admin Says:

    aren’t both those statements equivalent ? In any case, the first interpretation is correct: n should NOT appear in the running time. It sounds strange, but it’s true !

    p.s if you want to be overly particular, assume that operations on an individual element of the set (reading, writing, addressing etc) can be performed in constant time

  19. John M Says:

    For problem 2, we are dealing with a sorted input, right? Otherwise binary search doesn’t help us much.

  20. admin Says:

    ah. my mistake. So let me make one correction.

    * you can use super-linear pre-processing time (i.e you can sort if you want to).

  21. RH Says:

    What do you mean by ‘addressing’?

  22. admin Says:

    addressing: “Give me the 10th item in the set”.

  23. John M Says:

    But by that definition, we could again simply request the (n+1)/2 item in the input set to get the median, correct?

  24. John M Says:

    Never mind, unsorted input set >_<

  25. Vikas Says:

    Can we consider that the greedy algorithm uses the same ordering as OPT in problem 4a, to show that greedy coloring uses optimal number of colors??

  26. RH Says:

    Is the ‘10th’ just position in the unsorted input, with nothing to do with the rank?

  27. admin Says:

    You are confusing yourselves here, and I’m confusing you because I’m thinking about issues that you are not worried about (which is fine for this problem). Going back to basics, n should not appear in the running time, and that’s it.

    Vikas: But what is OPT ? it is not obvious that *any* ordering will guarantee that greedy works: what I’m asking you to show is that there *is* some ordering that works.

  28. Tilottama Says:

    On question 4, both parts , it says”show”….dow we ome up with exaples/counterexamples or do we need a formalized mathematial proof?
    Also, the ordering is not speified. When we proove(either with examples or math), do we proove it for a partiular ordering?

  29. Tilottama Says:

    rather, an we assume (& state) a definite ordering and proove it from there….?

  30. admin Says:

    Please read the last bullet on the first page. “Show” = “prove”. A proof may involve a counter example, but it also involves proving why the counter-example *is* one.

    4a says “Show that for all graphs, there exists an ordering…”
    4b says “Show that there exists a graph AND an ordering”….

  31. admin Says:

    and if I may get on my personal soapbox, there’s no such thing as a “proof with math” and a “proof with examples”. A proof is a proof is a proof. It’s not formalized or mathematical or anything: it is just a sequence of logical inferences, one following from another.

    What people are thinking of when they think of a “non-formalized” proof is a sketchy handwave that misses key steps, but which the author hopes will work. Remember the skeptical verifier !

  32. Pramod Says:

    I saw only 4 questions in the final yesterday. But now I see five. Do we have to answer all the questions or do we get a choice ?

  33. admin Says:

    say what ? oops. let me fix that. no there’s no 5th question

  34. Tilottama Says:

    On question 1, I wanted to verify this even though it has been mentioned: Could my running time be dependent both on n and epsilon-or on epsilon alone?

  35. admin Says:

    No, it only depends on epsilon

  36. Parasaran Says:

    For the Sloppy Search, is there a limit on the possible values of \eps in terms of n, or can \eps just be anything in the range (0,1)?

  37. Questioner Says:

    For sloppy search, am I correct in assuming that we don’t know what q or epsilon are during our preprocessing?

  38. admin Says:

    parasaran: eps can be anything.
    Questioner: epsilon is given in advance, but not q.

  39. Parasaran Says:

    Maybe i am missing something, But what happens in the following case? Given eps, if the data distribution is such that for any q that is provided as input, there is *atmost* one element within the (1+eps)q - (1-eps)q range (in the data set), will the bound still work?

    If it does, havent we acheived some superfast search mechanism without compromising the search quality?

  40. admin Says:

    It’s a good point, and if the bound works, then it does seem like we’ve achieved something fast. But we’ve compromised on something: “there is at most one element in the range for any q”. not all point sets can satisfy that criterion, and so the lower bound, which applies to an ARBITRARY point set, no longer is valid

  41. admin Says:

    btw: epsilon can be more than 0.5 (I was thinking of a different formulation of the problem). epsilon will be less than 1. this doesn’t really matter either way though

  42. Adam Says:

    Question 2 talks about being “willing to be sloppy …”, being “willing to tolerate …”, and “we are *allowed* to return …”.
    If (for epsilon=.1) the query is q = 5, and our set S = {4.99, 5.01} can we return that 5 is not in S, or are we required to return an entry (if we have one) that is close enough?

  43. admin Says:

    but in this case, 4.99 is within the bounds, and so you should return it. the goal *is* to provide a binary search: that part is not optional. What’s relaxed is the accuracy of the answer returned

  44. Adam Says:

    It just seemed that to say that 5 wasn’t in the set (rather than returning 4.99 or 5.01) would be a *more* accurate answer so I wondered if it would be “correct” to do so.

    I guess another way to ask the same question would be:
    Assuming that a regular (exact) binary search on the entire set were fast enough (which of course it isn’t), would it satisfy the specification, as far as correctness goes, for all values of epsilon?
    (Don’t ask me why I care. :-)

    Does the question make sense?

    Thanks.

  45. admin Says:

    Well it would satisfy the specification for eps = 0.

  46. Mike Clark Says:

    Any more hints you can give on question 2? I’m sure there are many of us who could appreciate it :)

  47. admin Says:

    I’m an infinitely powerful Prover, with no desire to convince you, the Verifier :). I don’t provide information, but I will (occasionally) respond to queries.

  48. Tilottama Says:

    For paper submissions-dow we still slip them under your door….I dont want to messup like last time….

  49. admin Says:

    yup. under my door it is

  50. Suman Says:

    In problem 2 is there any space restriction in the preprocessing step ? i.e. can we store any amount of information during the preprocessing step or do we have some bound ?

Leave a Reply