1

Suppose we are at the centre of a $k$ road intersection (i.e, there are $k$ different roads radiating out from where we are standing, infinitely). Suppose along one of these roads is a treasure.

This treasure is along one of these roads at distance $d \in \mathbb{Z}$ from the center. We do not know which road and we do not know $d$ either.

I am looking for a deterministic algorithm that has cost at most $8kd$, and in fact, possibly a cost bound of $ckd$ where $c < 8$.

My thinking is that the best algorithm is probably to go down road $1$ for $1$ unit, $2$ for $2$ units and on and on. This will incur distance $2n$ at each step, and once we hit $2d$ we can hope to find the treasure. But in the worst case scenario, we will have to try $k-1$ more roads before we get there in which case the total distance will be:

$2 + 4 + 6 + ... + 2d + 2(d+1) + ... + 2(d + k-2) + d$ which is quadratic in $k$ and $d$ and probably not the right bound.

Other possible algorithms include trying to go for $1$ unit across all $k$ roads, and then $2$ units across all $k$ roads and so on. This will give a max cost of:

$2k + 4k + 6k + ... + 2dk - d= (d)(d+1)k - d$ which still doesn't work.

I'm not sure where $8$ comes from and I'm not sure if I should be leaning on other problems like the ski-rental schema, etc.

0 Answers0