First off, I'm brand new to algorithms.
I thought of the problem and had no idea how to solve it, so to gain better understanding of algorithmic techniques, I thought I'd ask it here.
I was thinking of comets, and how people knew how many comets passed by Earth and such before modern technology.
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.