Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Corrections to the key
As the problem states: For example, if the invocation of f(a) finds table[a] non-empty and it is the first invocation to do so, then f(a) would be the answer.

Clearly f(2) is the first invocation to find a non-empty slot in the table. f(3) does not until after f(2). f(4) does not until after f(2).

Your logic for this problem is faulty. Here's why:

Clearly f(0) and f(1) involve the base cases. I'm sure we all agree on that.

You seem to be saying that since f(2) calls f(0) and f(1) and f(0) and f(1) involve base cases, then f(2) also involves base cases. By that logic, since f(3) calls f(2) and f(2) involves base cases, then f(3) involves base cases. Likewise, f(4) involves base cases since it calls f(3), and so on.

Under your interpretation, to get this chain to stop at f(2) and f(3), you have to change the wording of the question.

That said, I will accept 4 and 3 as an alternate answers, but those are not a logical results.
(10-31-2018, 07:02 PM)pahartman1 Wrote: Also why is 13 redundant? i thought that since it has 2 dimensions the redundancy had to be both x AND y, like an ordered pair? And i thought that it never was redundant because i didn't think g would ever be called twice with the same value for both i and j. Am i just totally wrong, or does it not matter because they are independent of each other and they individually return 0(the same value) weather either one(or both) hits its base case? (The answer I chose was "no, there are no redundant calculations")

I also had this question - can anyone explain?
If you had the correct answer before the key was changed, will you receive a 0 on that question since you changed the answer on the key? For instance, if I had an answer and it was correct according to the key, but then it was updated later and now the answer that was marked as correct initially would be now marked as wrong?
It will be marked wrong.

Forum Jump:

Users browsing this thread: 1 Guest(s)