The problem
- There is an unknown, fixed number of comets, numComets that pass by Earth and are visible from the ground.
- Each comet takes a fixed number of years to orbit Earth.
- Based only on this knowledge and the dates recorded that a comet was sighted in the night sky, determine numComets, AND determine the orbital period of each comet. You can use an unlimited amount of observation data (time), but the solution in the shortest amount of
time is preferable.
Assumptions you can make
- All comets look identical from the ground; there is no way to visually identify them.
- No other object will be mistaken for a comet, and all comets will be seen.
- No comet takes more than 100 years to orbit Earth, and no new comets will be introduced.
As current answers have pointed out, the problem as it lay now is unsolvable. Would a solution be possible if numComets is known? (Even roughly get the right answer?) What modifications to the problem would have to be made otherwise, to still encasulate the spirit of the problem, and make it solvable? (or is it dead with no hope of solving accurately?)
Further assumption
All comets start at a different point in their orbit. I.e. They do not all start their orbit at the same place like racehorses coming out of a gate.
Clarification
Comets are only recorded once per year. So there is no difference between a comet that passes at the beginning of a year and at the end. The problem could just as easily have been worded as days.
Asked By : Airhead
Answered By : lPlant
Best Answer from StackOverflow
Question Source : http://cs.stackexchange.com/questions/28832