Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Since there is no deterministic solution for the problem (as stated by @Mark Byers), you can try a probabilistic approach.</p> <p>It's difficult to obtain the original progression, but its rate can be obtained easily by comparing the differences between elements. The difference of original ones will be multiples of rate. </p> <p>Consider you take 2 elements from the list (probability that both of them belongs to the original sequence is <code>1/4</code>), and compute the difference. This difference, with probability of 1/4, will be a multiple of the rate. Decompose it to prime factors and count them (for example, <code>12 = 2^^2 * 3</code> will add 2 to 2's counter and will increment 3's counter).</p> <p>After many such iterations (it looks like a good problem for probabilistic methods, like <a href="http://en.wikipedia.org/wiki/Monte_Carlo_method" rel="nofollow">Monte Carlo</a>), you could analize the counters.</p> <p>If a prime factor belongs to the rate, its counter will be at least <code>num_iteartions/4</code> ( or <code>num_iterations/2</code> if it appears twice).</p> <p>The main problem is that small factors will have large probability on random input (for example, the difference between two random numbers will have 50% probability to be divisible by 2). So you'll have to compensate it: since 3/4 of your differences were random, you'll have to consider that <code>(3/8)*num_iterations</code> of 2's counter must be ignored. Since this also applies to all powers of two, the simpliest way is to pregenerate "white noise mask" by taking the differences only between random numbers.</p> <p>EDIT: let's take this approach further. Consider that you create this "white noise mask" (let's call it <em>spectrum</em>) for random numbers, and consider that it's base-1 spectrum, since their smallest "largest common factor" is 1. By computing it for a differences of the arithmetic sequence, you'll obtain a base-R spectrum, where <code>R</code> is the rate, and it will equivalent to a shifted version of base-1 spectrum. So you have to find the value of R such that </p> <pre><code>your_spectrum ~= spectrum(1)*3/4 + spectrum(R)*1/4 </code></pre> <p>You could also check for largest number <code>R</code> such that at least half of the elements will be equal modulo <code>R</code>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload