Re: Finding minimum in arithmetic series modulo N



On 2008-04-10, 3130@xxxxxxxx <3130@xxxxxxxx> wrote:
x(k) = (A + kD) mod N
[...]
k takes values 0, 1, 2 ... M-1.
[ Find minimum x(k) ]

I'm guessing you mean the ordering in which n-1 < n for n != 0 mod N.
Yes, there certainly are methods of search that are much better than
brute force. Think of where the successive values of the sequence
"land".

You start at A and increment by D, eventually exceeding N and wrapping
around to some value m1 < D at k = k1. If k1 >= M then A is the
smallest value.

Now consider only every floor(N/D) iterations from then on. Obviously
none of the intermediate values can be a minimum. Successive values
in this sequence increase by some amount r < D. If r > 0 you can now
reduce the problem to be that of finding the minimum value of
x'(k') = (m1 + k' r) mod D, for 0 <= k' < M / floor(N/D).


- Tim
.



Relevant Pages

  • Re: Magic Sinewave short sequence
    ... Stupid suggestion: ... How about brute force? ... Use a Genetic Algorithm to guess a bit sequence, ...
    (sci.electronics.design)
  • Re: Help with Lisp type system
    ... I'd like to make an unsigned-byte 8 sequence containing these two ... The brute force way: ... But surely I ought to be able to use:initial-contents to populate the ...
    (comp.lang.lisp)
  • Re: SHA1 Question
    ... > Suppose I have some unknow sequence of 7 bytes. ... > find original 7 bytes sequence used to produce that SHA? ... Someone will correct me if I'm wrong, but AFAIK, brute force is the ...
    (sci.crypt)
  • Help with Lisp type system
    ... I'd like to make an unsigned-byte 8 sequence containing these two ... The brute force way: ... But surely I ought to be able to use:initial-contents to populate the ...
    (comp.lang.lisp)
  • Re: How to find the maximum sum of atleast L consecutive integers given a sequence of N integers.
    ... How can we find the maximum sum of atleast L consecutive integers given ... The brute force approach of forming all possible length sequences at ... Create a new sequence by replacing each run of adjacent positive ... Using the index match this back to the original sequence. ...
    (comp.programming)