Question: A research team in oceanography has a probe that sends back temperature readings at regular time intervals. Unfortunately, they think the probe is faulty: not

A research team in oceanography has a probe that sends back temperature readings at regular time intervals. Unfortunately, they think the probe is faulty: not only does the team not know how "regular time intervals" is supposed to be defined, but they think some of the measurements haven't been transmitted and are therefore missing from the received data.
The input to your algorithm will be an array A of measurement times. For simplicity, we will assume each time is a non-negative integer. If the measurements don't exclude any data, then the array A will be of the form [a1, a1+ c, a1+2c,..., a1+(n 1)c], where A has length n (for n >=2) and c is the (constant) time interval between two consecutive measurements.
However let us suppose the probe failed to send k measurements, but that neither the first nor the last measurement were skipped. For example, the missing measurement times in [3,6,12,18,24,27] might be 9,15 and 21.
What if you are not told k, but you are given an upper bound K on its value. You will be able to determine c and k as long as the array you receive contains at least f(K) values.
What is f(K), and why?
Can you provide a detailed explanation of how to determine f(K)?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!