Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > sci.math > #334268 > unrolled thread

About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43

Started byDavid Bernier <david250@videotron.ca>
First post2016-05-18 15:30 -0400
Last post2016-05-23 18:29 -0400
Articles 20 on this page of 58 — 4 participants

Back to article view | Back to sci.math


Contents

  About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-18 15:30 -0400
    Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-18 16:18 -0400
      Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 richard@cogsci.ed.ac.uk (Richard Tobin) - 2016-05-18 20:46 +0000
        Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-18 18:43 -0400
          Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 richard@cogsci.ed.ac.uk (Richard Tobin) - 2016-05-18 22:52 +0000
            Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-18 19:41 -0400
              Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 richard@cogsci.ed.ac.uk (Richard Tobin) - 2016-05-18 23:54 +0000
                Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 richard@cogsci.ed.ac.uk (Richard Tobin) - 2016-05-18 23:56 +0000
                  Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 richard@cogsci.ed.ac.uk (Richard Tobin) - 2016-05-19 00:11 +0000
                    Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-18 23:06 -0400
                      Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-20 02:38 -0400
                        Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 richard@cogsci.ed.ac.uk (Richard Tobin) - 2016-05-20 08:03 +0000
                          Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-20 05:17 -0400
                            Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 richard@cogsci.ed.ac.uk (Richard Tobin) - 2016-05-20 09:39 +0000
                            Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-20 05:48 -0400
                          Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-21 04:01 -0400
                            Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-21 05:11 -0400
                              Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 richard@cogsci.ed.ac.uk (Richard Tobin) - 2016-05-21 09:39 +0000
                                Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-21 06:58 -0400
                    Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 James Waldby <not@valid.invalid> - 2016-05-19 04:17 +0000
                      Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-20 17:41 -0400
                        Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-20 17:52 -0400
                        Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 James Waldby <not@valid.invalid> - 2016-05-21 01:35 +0000
                  Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-18 21:22 -0400
                Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-18 20:54 -0400
              Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-18 20:21 -0400
      Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-18 17:57 -0400
        Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 richard@cogsci.ed.ac.uk (Richard Tobin) - 2016-05-18 23:44 +0000
          Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-19 00:03 -0400
        Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-05-19 01:02 +0100
          Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-18 22:12 -0400
      Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-05-19 01:59 +0100
        Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-18 23:18 -0400
          Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-05-19 10:58 +0100
            Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-19 06:14 -0400
              Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-05-19 13:56 +0100
                Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 richard@cogsci.ed.ac.uk (Richard Tobin) - 2016-05-19 13:00 +0000
                Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-19 09:52 -0400
                  Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-05-19 21:31 +0100
        Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 richard@cogsci.ed.ac.uk (Richard Tobin) - 2016-05-19 07:54 +0000
          Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 richard@cogsci.ed.ac.uk (Richard Tobin) - 2016-05-19 09:44 +0000
    Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 richard@cogsci.ed.ac.uk (Richard Tobin) - 2016-05-19 00:30 +0000
      Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-18 23:07 -0400
      Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-19 01:42 -0400
        Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-19 03:02 -0400
          Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-19 04:02 -0400
            Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-19 06:25 -0400
      Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-19 07:33 -0400
        Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-19 09:18 -0400
          Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-19 09:43 -0400
            Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-19 10:15 -0400
    Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 richard@cogsci.ed.ac.uk (Richard Tobin) - 2016-05-21 15:07 +0000
      Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-21 13:42 -0400
        Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-22 18:13 -0400
          Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-22 23:26 -0400
            Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-23 00:04 -0400
              Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-23 06:36 -0400
                Re: About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43 David Bernier <david250@videotron.ca> - 2016-05-23 18:29 -0400

Page 1 of 3  [1] 2 3  Next page →


#334268 — About low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43

FromDavid Bernier <david250@videotron.ca>
Date2016-05-18 15:30 -0400
SubjectAbout low-discrepancy finite sequences {a_1, a_2, .... a_M} for M = 43
Message-ID<nhifmc$jl1$1@dont-email.me>
In late 2015, Terence Tao posted a preprint to arXiv announcing the
solution of the Erdos discrepancy problem, unsolved for decades.

It's now been electronically published in "Discrete Analysis",
a new kind of peer-reviewed "list" of arxiv pre-prints,
and whose home page is the following:

< http://discreteanalysisjournal.com/ > .

The arXiv link to Tao's pre-print is this:
< http://arxiv.org/abs/1509.05363v5 > .

Tao uses 'd' for the common difference in arithmetic progressions,
and 'n' for the length of an arithmetic progression.

As can be seen from the abstract, the only aritmetic progressions
involved, for a fixed value of the common difference 'd', all begin
with d.

Hence, the length 'n' arithmetic progression of common difference 'd'
starting with the term 'd' is the following:

{ d, 2d, 3d, .....  n*d }

where we use braces to enclose the finite arithmetic
progression, for convenience.

The statement of Tao's main theorem , solving the Erdos problem,

is this:

if  f: N^* -> {-1, 1} is
an infinite sequence taking values in the set {-1, 1}, and
indexed by the positive integers 1, 2, 3, .... or in other
words N^*, then:

sup_{1<= d < OO, 1<= n < oo} [ | sum_{j=1 .... n} f(j*d) | ] = oo .

This means that for every such f, as vary n and d over the allowed
values in the parameter space, the quantities
Absolute_Value( sum_{j=1, ... n} ( f(j*d) )   )
are unbounded, whatever 'f' may be.

===

What I've looked at numerically is for low-discrepancy
sequences of length 43 taking values in {-1, 1} .
If {s_1, s_2, .... s_43} is a finite sequence of
length 43 taking values in {-1, 1}, then I define
the discrepancy D of {s_1, s_2, .... s_43} as follows:

D = max_{(d,n) in N*xN* s.t. dn <= 43} continued...
  { |sum_{j=1,...n} s_{j*d}| } .

For d = 1, n can vary from 1 to 43.
For d = 2, n can vary from 1 to 21.
For d = 3, n can vary from 1 to 14.
For d = 4, n can vary from 1 to 10.
For d = 5, n can vary from 1 to  8.
For d = 6, n can vary from 1 to  7.
For d = 7, n can vary from 1 to 6.
For d = 8, n can vary from 1 to 5.
For d = 9, n can vary from 1 to 4.
For d = 10, n can vary from 1 to 4.
...
For d = 43, n can only take the value 1, so as to respect n*d <= 43.

The idea of the discrepancy D is, for each of those
finite A.P.'s mentioned above, to look at absolute values
of s_d + s_{2d} + ... s_{nd}, and to see how large
the maximum of the absolute values is.

I wrote a computer program to search exhaustively
through the 2^43 possible sequences
{s_1, s_2, .... s_43} to search for the minimum
discrepancy D possible for these 2^43 sequences.

My program says that D = 6 is possible with the special
case:
{s_1, s_2, .... s_43} =

{ 1, 1, 1, 1, 1, -1,
1, -1, 1, -1, 1, -1,
1, -1, 1, 1, -1, 1,
-1, 1, -1, 1, -1, 1,
-1, 1, -1, 1, -1, 1,
-1, 1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1,
-1 }

As that is perhaps liable to confuse, I'll rewrite it as symbols + and
-, standing in for +1 and -1:

+++++-
+-+-+-
+-++-+
-+-+-+
-+-+-+
-+----
------
-

or on a single line:

+++++-+-+-+-+-++-+-+-+-+-+-+-+-+-----------

My program hasn't finished examining all possible
2^43 sequences of +1 or -1. Secondly, I had to
eliminate bugs for hours before I got a program that
appeared to be finding low-discrepancy finite sequences
of length 43.

In particular, I haven't checked by myself the
disrepancy D = 6 that the program finds for the
length 43 sequence mentioned above.

David Bernier

P.S. Maybe someone has references on studies
     of finite length low-discrepancy sequences ?

-- 
pub   4096R/41C769D6 2014-11-04
uid                  David Bernier (doubledeckerpot5)
<david250@videotron.ca>

[toc] | [next] | [standalone]


#334270

FromDavid Bernier <david250@videotron.ca>
Date2016-05-18 16:18 -0400
Message-ID<nhiig2$ups$1@dont-email.me>
In reply to#334268
On 05/18/2016 03:30 PM, David Bernier wrote:
> In late 2015, Terence Tao posted a preprint to arXiv announcing the
> solution of the Erdos discrepancy problem, unsolved for decades.
> 
> It's now been electronically published in "Discrete Analysis",
> a new kind of peer-reviewed "list" of arxiv pre-prints,
> and whose home page is the following:
> 
> < http://discreteanalysisjournal.com/ > .
> 
> The arXiv link to Tao's pre-print is this:
> < http://arxiv.org/abs/1509.05363v5 > .
> 
> Tao uses 'd' for the common difference in arithmetic progressions,
> and 'n' for the length of an arithmetic progression.
> 
> As can be seen from the abstract, the only aritmetic progressions
> involved, for a fixed value of the common difference 'd', all begin
> with d.
> 
> Hence, the length 'n' arithmetic progression of common difference 'd'
> starting with the term 'd' is the following:
> 
> { d, 2d, 3d, .....  n*d }
> 
> where we use braces to enclose the finite arithmetic
> progression, for convenience.
> 
> The statement of Tao's main theorem , solving the Erdos problem,
> 
> is this:
> 
> if  f: N^* -> {-1, 1} is
> an infinite sequence taking values in the set {-1, 1}, and
> indexed by the positive integers 1, 2, 3, .... or in other
> words N^*, then:
> 
> sup_{1<= d < OO, 1<= n < oo} [ | sum_{j=1 .... n} f(j*d) | ] = oo .
> 
> This means that for every such f, as vary n and d over the allowed
> values in the parameter space, the quantities
> Absolute_Value( sum_{j=1, ... n} ( f(j*d) )   )
> are unbounded, whatever 'f' may be.
> 
> ===
> 
> What I've looked at numerically is for low-discrepancy
> sequences of length 43 taking values in {-1, 1} .
> If {s_1, s_2, .... s_43} is a finite sequence of
> length 43 taking values in {-1, 1}, then I define
> the discrepancy D of {s_1, s_2, .... s_43} as follows:
> 
> D = max_{(d,n) in N*xN* s.t. dn <= 43} continued...
>   { |sum_{j=1,...n} s_{j*d}| } .
> 
> For d = 1, n can vary from 1 to 43.
> For d = 2, n can vary from 1 to 21.
> For d = 3, n can vary from 1 to 14.
> For d = 4, n can vary from 1 to 10.
> For d = 5, n can vary from 1 to  8.
> For d = 6, n can vary from 1 to  7.
> For d = 7, n can vary from 1 to 6.
> For d = 8, n can vary from 1 to 5.
> For d = 9, n can vary from 1 to 4.
> For d = 10, n can vary from 1 to 4.
> ...
> For d = 43, n can only take the value 1, so as to respect n*d <= 43.
> 
> The idea of the discrepancy D is, for each of those
> finite A.P.'s mentioned above, to look at absolute values
> of s_d + s_{2d} + ... s_{nd}, and to see how large
> the maximum of the absolute values is.
> 
> I wrote a computer program to search exhaustively
> through the 2^43 possible sequences
> {s_1, s_2, .... s_43} to search for the minimum
> discrepancy D possible for these 2^43 sequences.
> 
> My program says that D = 6 is possible with the special
> case:
> {s_1, s_2, .... s_43} =
> 
> { 1, 1, 1, 1, 1, -1,
> 1, -1, 1, -1, 1, -1,
> 1, -1, 1, 1, -1, 1,
> -1, 1, -1, 1, -1, 1,
> -1, 1, -1, 1, -1, 1,
> -1, 1, -1, -1, -1, -1,
> -1, -1, -1, -1, -1, -1,
> -1 }
> 
> As that is perhaps liable to confuse, I'll rewrite it as symbols + and
> -, standing in for +1 and -1:
> 
> +++++-
> +-+-+-
> +-++-+
> -+-+-+
> -+-+-+
> -+----
> ------
> -
> 
> or on a single line:
> 
> +++++-+-+-+-+-++-+-+-+-+-+-+-+-+-----------
> 
> My program hasn't finished examining all possible
> 2^43 sequences of +1 or -1. Secondly, I had to
> eliminate bugs for hours before I got a program that
> appeared to be finding low-discrepancy finite sequences
> of length 43.
> 
> In particular, I haven't checked by myself the
> disrepancy D = 6 that the program finds for the
> length 43 sequence mentioned above.

PARI/gp also gave D = 6.

It seems I can find, using pseudo-random sequences,
finite sequences of discrepancy D = 3, in PARI/gp.

That's the lowest Discrepancy so far, for length 43 sequences.



> 
> David Bernier
> 
> P.S. Maybe someone has references on studies
>      of finite length low-discrepancy sequences ?
> 


-- 
pub   4096R/41C769D6 2014-11-04
uid                  David Bernier (doubledeckerpot5)
<david250@videotron.ca>

[toc] | [prev] | [next] | [standalone]


#334271

Fromrichard@cogsci.ed.ac.uk (Richard Tobin)
Date2016-05-18 20:46 +0000
Message-ID<nhikae$2op9$1@macpro.inf.ed.ac.uk>
In reply to#334270
In article <nhiig2$ups$1@dont-email.me>,
David Bernier  <david250@videotron.ca> wrote:

>> What I've looked at numerically is for low-discrepancy
>> sequences of length 43 taking values in {-1, 1} .

Do you have results for lengths < 43 that can be used for testing?

-- Richard

[toc] | [prev] | [next] | [standalone]


#334273

FromDavid Bernier <david250@videotron.ca>
Date2016-05-18 18:43 -0400
Message-ID<nhir0h$264$1@dont-email.me>
In reply to#334271
On 05/18/2016 04:46 PM, Richard Tobin wrote:
> In article <nhiig2$ups$1@dont-email.me>,
> David Bernier  <david250@videotron.ca> wrote:
> 
>>> What I've looked at numerically is for low-discrepancy
>>> sequences of length 43 taking values in {-1, 1} .
> 
> Do you have results for lengths < 43 that can be used for testing?
> 
> -- Richard
> 

No, I don't. I'm confident in my PARI/gp implementation, however, so
if you specify a range of lengths for the finite sequences,
e.g. lengths 10 to 20, then I could search for
low-discrepancy sequences for those specified lengths.

They might not have minimal discrepancy over all sequences
of +1's and -1's of length (say) 17,
but I'm fairly confident the discrepancies D will be correct.

Perhaps two or three test lengths would be a good start,
for testing and corroboration purposes ...

David Bernier


-- 
pub   4096R/41C769D6 2014-11-04
uid                  David Bernier (doubledeckerpot5)
<david250@videotron.ca>

[toc] | [prev] | [next] | [standalone]


#334274

Fromrichard@cogsci.ed.ac.uk (Richard Tobin)
Date2016-05-18 22:52 +0000
Message-ID<nhiro4$2sks$1@macpro.inf.ed.ac.uk>
In reply to#334273
In article <nhir0h$264$1@dont-email.me>,
David Bernier  <david250@videotron.ca> wrote:
>>>> What I've looked at numerically is for low-discrepancy
>>>> sequences of length 43 taking values in {-1, 1} .

[...]

Can you confirm that the discrepancy for this length-38 sequence is 2?

 ++-+-+--+--++-+--++-++-+--+--++-++-+-+

Do you have a length-42 sequence with discrepancy 2?  Clearly that
is necessary for there to be a length-43 one.

-- Richard

[toc] | [prev] | [next] | [standalone]


#334275

FromDavid Bernier <david250@videotron.ca>
Date2016-05-18 19:41 -0400
Message-ID<nhiud1$c7v$1@dont-email.me>
In reply to#334274
On 05/18/2016 06:52 PM, Richard Tobin wrote:
> In article <nhir0h$264$1@dont-email.me>,
> David Bernier  <david250@videotron.ca> wrote:
>>>>> What I've looked at numerically is for low-discrepancy
>>>>> sequences of length 43 taking values in {-1, 1} .
> 
> [...]
> 
> Can you confirm that the discrepancy for this length-38 sequence is 2?
> 
>  ++-+-+--+--++-+--++-++-+--+--++-++-+-+
> 
> Do you have a length-42 sequence with discrepancy 2?  Clearly that
> is necessary for there to be a length-43 one.
> 
> -- Richard
> 

I'll do that. No, my PARI/gp implementation is slow, and
I've only completed the 2^29 length-29 sequences in C, where
apparently a discrepancy of 2 is possible, but not a
discrepancy below 2 ...

Test sequence of length 29:

discrepancy = 2,
sequence is:
{1,-1,1,1,-1,-1,1,1,-1,1,-1,-1,1,-1,1,-1,1,1,-1,-1,1,1,-1,1,-1,1,-1,-1,-1}.

David


-- 
pub   4096R/41C769D6 2014-11-04
uid                  David Bernier (doubledeckerpot5)
<david250@videotron.ca>

[toc] | [prev] | [next] | [standalone]


#334277

Fromrichard@cogsci.ed.ac.uk (Richard Tobin)
Date2016-05-18 23:54 +0000
Message-ID<nhivc7$2tmd$2@macpro.inf.ed.ac.uk>
In reply to#334275
In article <nhiud1$c7v$1@dont-email.me>,
David Bernier  <david250@videotron.ca> wrote:

>Test sequence of length 29:
>
>discrepancy = 2,
>sequence is:
>{1,-1,1,1,-1,-1,1,1,-1,1,-1,-1,1,-1,1,-1,1,1,-1,-1,1,1,-1,1,-1,1,-1,-1,-1}.

Perhaps I am misunderstanding - the discrepancy there appears to be 5.

d = 3, n = 5:

{1,-1,1,1,-1,-1,1,1,-1,1,-1,-1,1,-1,1,-1,1,1,-1,-1,1,1,-1,1,-1,1,-1,-1,-1}.
 *      *       *      *       *

-- Richard

[toc] | [prev] | [next] | [standalone]


#334278

Fromrichard@cogsci.ed.ac.uk (Richard Tobin)
Date2016-05-18 23:56 +0000
Message-ID<nhivff$2tmd$3@macpro.inf.ed.ac.uk>
In reply to#334277
In article <nhivc7$2tmd$2@macpro.inf.ed.ac.uk>,
Richard Tobin <richard@cogsci.ed.ac.uk> wrote:

>Perhaps I am misunderstanding - the discrepancy there appears to be 5.
>
>d = 3, n = 5:
>
>{1,-1,1,1,-1,-1,1,1,-1,1,-1,-1,1,-1,1,-1,1,1,-1,-1,1,1,-1,1,-1,1,-1,-1,-1}.
> *      *       *      *       *

Ok, I see my mistake.  I was using 1, 1+d, 1+2d, ... instead of d, 2d, ...

Ignore my other messages!

-- Richard

[toc] | [prev] | [next] | [standalone]


#334280

Fromrichard@cogsci.ed.ac.uk (Richard Tobin)
Date2016-05-19 00:11 +0000
Message-ID<nhj0c5$2uva$1@macpro.inf.ed.ac.uk>
In reply to#334278
In article <nhivff$2tmd$3@macpro.inf.ed.ac.uk>,
Richard Tobin <richard@cogsci.ed.ac.uk> wrote:

>Ok, I see my mistake.  I was using 1, 1+d, 1+2d, ... instead of d, 2d, ...

After correcting my mistake:

  ++-+--+-++-+--++--+-++-+----++++--+-+-+-++-

and

  ++-+--+-++-+--++--+-++-+----+-++-++-+-+-++--++---+-+-++-++-+---+--+-+++-+--+++--+--++--+++-+----++++

-- Richard

[toc] | [prev] | [next] | [standalone]


#334298

FromDavid Bernier <david250@videotron.ca>
Date2016-05-18 23:06 -0400
Message-ID<nhjaco$aek$1@dont-email.me>
In reply to#334280
On 05/18/2016 08:11 PM, Richard Tobin wrote:
> In article <nhivff$2tmd$3@macpro.inf.ed.ac.uk>,
> Richard Tobin <richard@cogsci.ed.ac.uk> wrote:
> 
>> Ok, I see my mistake.  I was using 1, 1+d, 1+2d, ... instead of d, 2d, ...
> 
> After correcting my mistake:
> 
>   ++-+--+-++-+--++--+-++-+----++++--+-+-+-++-

for your length 43 sequence, I get
discrepancy D = 2.

You've gone further than I. I'm wondering how hard it is
to force a discrepancy >= 3 for all finite sequences of
length L? We know L > 43, from the above, AFAIK.

> 
> and
> 
>   ++-+--+-++-+--++--+-++-+----+-++-++-+-+-++--++---+-+-++-++-+---+--+-+++-+--+++--+--++--+++-+----++++

I have yet to test this one.
Very cool...

David Bernier

-- 
pub   4096R/41C769D6 2014-11-04
uid                  David Bernier (doubledeckerpot5)
<david250@videotron.ca>

[toc] | [prev] | [next] | [standalone]


#334369

FromDavid Bernier <david250@videotron.ca>
Date2016-05-20 02:38 -0400
Message-ID<nhmb6e$2md$1@dont-email.me>
In reply to#334298
On 05/18/2016 11:06 PM, David Bernier wrote:
> On 05/18/2016 08:11 PM, Richard Tobin wrote:
>> In article <nhivff$2tmd$3@macpro.inf.ed.ac.uk>,
>> Richard Tobin <richard@cogsci.ed.ac.uk> wrote:
>>
>>> Ok, I see my mistake.  I was using 1, 1+d, 1+2d, ... instead of d, 2d, ...
>>
>> After correcting my mistake:
>>
>>   ++-+--+-++-+--++--+-++-+----++++--+-+-+-++-
> 
> for your length 43 sequence, I get
> discrepancy D = 2.

I first obtained a D=2 sequence of length 33, and then I used PARI/gp to
extend it manually, arriving at a D = 2 sequence of length 44:

[-1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1,
-1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, 1,
1, -1, 1, -1]

or hopefully:

--+++---+++-++--++-+--++---++-+-++-+---++-+-

To extend it to a length 45 sequence, with discrepancy D=2
if possible, we only need to look at the progressions
d, 2d, ... j*d

where d is a proper divisor of 45, so this gives us:

d = 1,  d = 3, d = 5, d = 9  and d = 15.

For each 'd' in the set {1, 3, 5, 9, 15} we
can consider for d = 1, the 44th partial sum,
for d=3, the 14th partial sum, i.e.
s_3 + s_6 + s_9 + ... + s_42
for d=5 , the 8th partial sum , i.e.
s_5 + s_10 + s_15 + s_20 + ... s_40
and similarly for d=9 and  d = 15.

This can be summarized in the partial sums
ps(d) for d = 1, 3, 5, 9, 15
where ps (d) = sum_{j = 1, floor(44/d) } s_{jd}

Thus, s_45 will be extending the partial sums
pd(d) as defined above.

If, for example,
s_3 + s_6 + ... + s_42 is in the set {-1, 0, 1}
then whether s_45 is chosen to be +1 or -1, the new
partial sum
s_3 + ... s_42 + s_45 will be in the set: {-2, -1, 0, 1, 2}.

On the other hand, had we had
s_3 + s_6 + ... + s_42 in the set {-2, +2}
then only one choice of s_45 will ensure that
| s_3 + s_6 + ... s_42 + s_45 | <= 2.

So we can have 2 choices allowed to extend, just one,
or not at all, and this depends on the A.P.'s with
d dividing 45, namely 1 3 5 9 15.

Assuming we could extend to 45, then 46 terms in length.

Then, in trying to extend to a lentgh 47 sequence, since
47 is prime and the only proper divisor of 47 is d=1,
we need only look at one partial sum, logically:
s_1 + s_2 + ... s_46.

When there's a blockage (no extension possible with keeping
a discrepancy of two), I'm thinking of back-tracking;

From your computations not long ago concerning blocks of 5 digits of pi
which, with the right sign, sum to zero (partition problem), you seem
rather sophisticated with search algorithms.

Perhaps the ideas above on extending discrepancy D=2 sequences
would be amenable to a depth-first serach through a binary tree,
where at at node with two edges going down, extending by +1 would
be done before extending by a -1, when that is feasible.

Perhaps this is called a depth-first search through a binary tree,
with back-tracking. I'm not too familiar with depth-first search
methods, from my programming experience, although I've heard of such
things.

What do you think, does it seem feasible?

-- David

-- 
pub   4096R/41C769D6 2014-11-04
uid                  David Bernier (doubledeckerpot5)
<david250@videotron.ca>

[toc] | [prev] | [next] | [standalone]


#334370

Fromrichard@cogsci.ed.ac.uk (Richard Tobin)
Date2016-05-20 08:03 +0000
Message-ID<nhmgc7$1q55$1@macpro.inf.ed.ac.uk>
In reply to#334369
In article <nhmb6e$2md$1@dont-email.me>,
David Bernier  <david250@videotron.ca> wrote:

>I first obtained a D=2 sequence of length 33, and then I used PARI/gp to
>extend it manually, arriving at a D = 2 sequence of length 44:
>
>[-1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1,
>-1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, 1,
>1, -1, 1, -1]
>
>or hopefully:
>
>--+++---+++-++--++-+--++---++-+-++-+---++-+-
>
>To extend it to a length 45 sequence, with discrepancy D=2
>if possible, we only need to look at the progressions
>d, 2d, ... j*d
>
>where d is a proper divisor of 45, so this gives us:
>
>d = 1,  d = 3, d = 5, d = 9  and d = 15.

I had that idea too, and I'm running a C program that works like that.
After about 8 hours it had got a sequence of length 524:

++-+--+-++-+--++--+-++-+----+-++-++--++--+-++-+--++--+-+--+++--++-+-+-+--+-+++--+---++-+-++-+---++++-+---+++---++-++---+--+-+-+-+++--+--++-+-+++--+-+--+--++-++-+--++-+--+++-+-+--+--+--++-++-+-+---++-+-+-++---+++--+-+--+-+-++++---++-+--+--++++---+-++-++----+-++++---++-+-++--++-+--++--+--+++-+---+--+-+++-+--++--+-++-+-++--+--++--+-++-+-++---+++---+-++-+--+++---++-++-+--+-+-+--+++--++-+--+--+-+++----+++-+-+--+-++--++-++--+-++-+--+-++--++-+-+---++--+++--++--+-+-++-+---++-+--+++-+--+-++-+--++----+-++--++-++-+--+-++--++-+-++

But after another 11 hours it hasn't got any further - presumably it's
having to backtrack a long way.  I doubt it will reach 1160.

Incidentally, I see that the sequence 0,11,1160 is already in OEIS:
https://oeis.org/search?q=0%2C11%2C1160&language=english&go=Search

Here's the code, sadly uncommented:

/* Find finite sequences with discrepancy <= C */

#include <stdio.h>
#include <stdlib.h>

void extend(int *seq, int length, int C, int max_length);
void note(int *seq, int length);
void print_seq(int *seq, int length);
void init_divisors(int max_length);

int **divisors;
int *sums;

int main(int argc, char **argv)
{
    int max_length, C;
    int *seq;
    
    if(argc != 2 && argc != 3)
    {
	fprintf(stderr, "usage: %s C [max-length]\n", argv[0]);
	return 1;
    }
    
    C = atoi(argv[1]);
    max_length = argc > 2 ? atoi(argv[2]) : 2000;

    init_divisors(max_length);
    
    seq = calloc(max_length, sizeof(*seq));
    seq[0] = 1;

    sums = calloc(max_length+1, sizeof(*sums));
    sums[1] = 1;
	
    if(C >= 1)
    {
	note(seq, 1);
	extend(seq, 1, C, max_length);
    }

    printf("finished\n");
    
    return 0;
}

void extend(int *seq, int length, int C, int max_length)
{
    int d, *dd;
    static int gave_up = 0;
    
    if(length == max_length)
    {
	if(!gave_up)
	{
	    gave_up = 1;
	    fprintf(stderr, "reached maximum length\n");
	}

	return;
    }

    length = length+1;
    
    for(dd=divisors[length]; (d = *dd); dd++)
	if(sums[d] + 1 > C)
	    goto plus_failed;
    for(dd=divisors[length]; (d = *dd); dd++)
	sums[d]++;
    seq[length-1] = 1;
    note(seq, length);
    extend(seq, length, C, max_length);
    for(dd=divisors[length]; (d = *dd); dd++)
	sums[d]--;
    
plus_failed:
    
    for(dd=divisors[length]; (d = *dd); dd++)
	if(sums[d] - 1 < -C)
	    goto minus_failed;
    for(dd=divisors[length]; (d = *dd); dd++)
	sums[d]--;
    seq[length-1] = -1;
    note(seq, length);
    extend(seq, length, C, max_length);
    for(dd=divisors[length]; (d = *dd); dd++)
	sums[d]++;

minus_failed:
    ;
}

void note(int *seq, int length)
{
    static int longest=0;

    if(length > longest)
    {
	longest = length;
	printf("found sequence of length %d\n", length);
	print_seq(seq, length);
	printf("\n");
	fflush(stdout);
    }
}

void print_seq(int *seq, int length)
{
    int i;
    
    for(i=0; i<length; i++)
	putchar(seq[i] == 1 ? '+' : '-');
}

void init_divisors(int max_length)
{
    int i, j, count;

    divisors = calloc(max_length+1, sizeof(*divisors));
    
    for(i=0; i<=max_length; i++)
    {
	count = 0;
	for(j=1; j<=i; j++)
	    if(i%j == 0)
		count++;
	divisors[i] = calloc(count+1, sizeof(*divisors[i]));
	
	count = 0;
	for(j=1; j<=i; j++)
	    if(i%j == 0)
		divisors[i][count++] = j;
	divisors[i][count] = 0;
    }
}

[toc] | [prev] | [next] | [standalone]


#334372

FromDavid Bernier <david250@videotron.ca>
Date2016-05-20 05:17 -0400
Message-ID<nhmkh2$bk$1@dont-email.me>
In reply to#334370
On 05/20/2016 04:03 AM, Richard Tobin wrote:
> In article <nhmb6e$2md$1@dont-email.me>,
> David Bernier  <david250@videotron.ca> wrote:
> 
>> I first obtained a D=2 sequence of length 33, and then I used PARI/gp to
>> extend it manually, arriving at a D = 2 sequence of length 44:
>>
>> [-1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1,
>> -1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, 1,
>> 1, -1, 1, -1]
>>
>> or hopefully:
>>
>> --+++---+++-++--++-+--++---++-+-++-+---++-+-
>>
>> To extend it to a length 45 sequence, with discrepancy D=2
>> if possible, we only need to look at the progressions
>> d, 2d, ... j*d
>>
>> where d is a proper divisor of 45, so this gives us:
>>
>> d = 1,  d = 3, d = 5, d = 9  and d = 15.
> 
> I had that idea too, and I'm running a C program that works like that.
> After about 8 hours it had got a sequence of length 524:
> 
> ++-+--+-++-+--++--+-++-+----+-++-++--++--+-++-+--++--+-+--+++--++-+-+-+--+-+++--+---++-+-++-+---++++-+---+++---++-++---+--+-+-+-+++--+--++-+-+++--+-+--+--++-++-+--++-+--+++-+-+--+--+--++-++-+-+---++-+-+-++---+++--+-+--+-+-++++---++-+--+--++++---+-++-++----+-++++---++-+-++--++-+--++--+--+++-+---+--+-+++-+--++--+-++-+-++--+--++--+-++-+-++---+++---+-++-+--+++---++-++-+--+-+-+--+++--++-+--+--+-+++----+++-+-+--+-++--++-++--+-++-+--+-++--++-+-+---++--+++--++--+-+-++-+---++-+--+++-+--+-++-+--++----+-++--++-++-+--+-++--++-+-++
> 

I compiled it, and tried first ./a.out 1

(for discrepancy D = 1 sequences, and it stopped at length 11).

With ./a.out 2

there was a pause after length 359, and 360 has lots of divisors.

There was another pause searching for a length 390 sequence.

The length that comes after 524, namely 525, has the proper divisors
1, 3, 5, 7, 15, 21, 25, 35, 75, 105 and 175 .

The value after the feasible 1160, the impossible length 1161,
has divisors

1, 2, 4, 5, 8, 10, 20, 29, 40, 58, 116, 145, 232, 290 and 580.

The smallest impossible length for C = 1, which is 12, is also
rich in divisors, with a sum of proper divisors of 16, an
abundant number.

Manually, I took care of small cases by toggling s_p where
p is a medium prime, co-prime to the sough-for length L,
so gcd(p, L) = 1.

It may well be that the SAT-solver (even probable) is very
powerful. One of the Polymath projects dealt with long
sequences of discrepancy 2. I believe they were above 1000,
it's at Timothy Gowers's Blog.

David


> But after another 11 hours it hasn't got any further - presumably it's
> having to backtrack a long way.  I doubt it will reach 1160.
> 
> Incidentally, I see that the sequence 0,11,1160 is already in OEIS:
> https://oeis.org/search?q=0%2C11%2C1160&language=english&go=Search
> 
> Here's the code, sadly uncommented:
> 
> /* Find finite sequences with discrepancy <= C */
> 
> #include <stdio.h>
> #include <stdlib.h>

-- 
pub   4096R/41C769D6 2014-11-04
uid                  David Bernier (doubledeckerpot5)
<david250@videotron.ca>

[toc] | [prev] | [next] | [standalone]


#334373

Fromrichard@cogsci.ed.ac.uk (Richard Tobin)
Date2016-05-20 09:39 +0000
Message-ID<nhmm18$1t4b$1@macpro.inf.ed.ac.uk>
In reply to#334372
In article <nhmkh2$bk$1@dont-email.me>,
David Bernier  <david250@videotron.ca> wrote:

>The length that comes after 524, namely 525, has the proper divisors
>1, 3, 5, 7, 15, 21, 25, 35, 75, 105 and 175 .

Those small factors are the reason that US television had 525 lines :-)

>It may well be that the SAT-solver (even probable) is very
>powerful.

You can see why treating it as a constraint satisfaction problem is
going to be much better than simple backtracking.  Suppose you have
s_50 = s_100 = 1, and s_60 = 1, s_30 = s_90 = s_120 = -1.  Then
there's no possible value for s_150, but the backtracking program will
try all the possible values for s_121 ... s_149 before it finds out.

-- Richard

[toc] | [prev] | [next] | [standalone]


#334374

FromDavid Bernier <david250@videotron.ca>
Date2016-05-20 05:48 -0400
Message-ID<nhmm9s$62a$1@dont-email.me>
In reply to#334372
On 05/20/2016 05:17 AM, David Bernier wrote:
> On 05/20/2016 04:03 AM, Richard Tobin wrote:
>> In article <nhmb6e$2md$1@dont-email.me>,
>> David Bernier  <david250@videotron.ca> wrote:
>>
>>> I first obtained a D=2 sequence of length 33, and then I used PARI/gp to
>>> extend it manually, arriving at a D = 2 sequence of length 44:
>>>
>>> [-1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1,
>>> -1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, 1,
>>> 1, -1, 1, -1]
>>>
>>> or hopefully:
>>>
>>> --+++---+++-++--++-+--++---++-+-++-+---++-+-
>>>
>>> To extend it to a length 45 sequence, with discrepancy D=2
>>> if possible, we only need to look at the progressions
>>> d, 2d, ... j*d
>>>
>>> where d is a proper divisor of 45, so this gives us:
>>>
>>> d = 1,  d = 3, d = 5, d = 9  and d = 15.
>>
>> I had that idea too, and I'm running a C program that works like that.
>> After about 8 hours it had got a sequence of length 524:
>>
>> ++-+--+-++-+--++--+-++-+----+-++-++--++--+-++-+--++--+-+--+++--++-+-+-+--+-+++--+---++-+-++-+---++++-+---+++---++-++---+--+-+-+-+++--+--++-+-+++--+-+--+--++-++-+--++-+--+++-+-+--+--+--++-++-+-+---++-+-+-++---+++--+-+--+-+-++++---++-+--+--++++---+-++-++----+-++++---++-+-++--++-+--++--+--+++-+---+--+-+++-+--++--+-++-+-++--+--++--+-++-+-++---+++---+-++-+--+++---++-++-+--+-+-+--+++--++-+--+--+-+++----+++-+-+--+-++--++-++--+-++-+--+-++--++-+-+---++--+++--++--+-+-++-+---++-+--+++-+--+-++-+--++----+-++--++-++-+--+-++--++-+-++
>>
> 
> I compiled it, and tried first ./a.out 1
> 
> (for discrepancy D = 1 sequences, and it stopped at length 11).
> 
> With ./a.out 2
> 
> there was a pause after length 359, and 360 has lots of divisors.
> 
> There was another pause searching for a length 390 sequence.
> 
> The length that comes after 524, namely 525, has the proper divisors
> 1, 3, 5, 7, 15, 21, 25, 35, 75, 105 and 175 .
> 
> The value after the feasible 1160, the impossible length 1161,
> has divisors
> 
> 1, 2, 4, 5, 8, 10, 20, 29, 40, 58, 116, 145, 232, 290 and 580.
> 
> The smallest impossible length for C = 1, which is 12, is also
> rich in divisors, with a sum of proper divisors of 16, an
> abundant number.
> 
> Manually, I took care of small cases by toggling s_p where
> p is a medium prime, co-prime to the sough-for length L,
> so gcd(p, L) = 1.

For manually fixing unextendible sequence (without systematic
back-tracking), I fiddled with a few of the numbers, maybe up
to 10% or so. It could be interesting to take note of
the sign switches that allow a fixed sequence that can't be
properly extended.

Also, with the "blockage" on 525,
one could select say 4 or 5 values of the common
difference d to fiddle  with, to try to extend to
525, and include some prime indices from p = 179
to the largest prime below 525. Those indices
only affect partial sums of
s_1 + s_2 + ... s_525
(and not partial sums of for example s_10 + s_20 + ... s_520 )

If the set of indices to twiddle is of cardinality 20 or less,
a modest amount of computation could be tested exhaustively to either
find a lentgh 525 solution, or an improved non-solution
(generally, the first absolute values of 3 or more appear later, and
 better for d = 67 than for d = 1, 2 or 3 ... ).

David



-- 
pub   4096R/41C769D6 2014-11-04
uid                  David Bernier (doubledeckerpot5)
<david250@videotron.ca>

[toc] | [prev] | [next] | [standalone]


#334407

FromDavid Bernier <david250@videotron.ca>
Date2016-05-21 04:01 -0400
Message-ID<nhp4e6$c5k$1@dont-email.me>
In reply to#334370
On 05/20/2016 04:03 AM, Richard Tobin wrote:
> In article <nhmb6e$2md$1@dont-email.me>,
> David Bernier  <david250@videotron.ca> wrote:
> 
>> I first obtained a D=2 sequence of length 33, and then I used PARI/gp to
>> extend it manually, arriving at a D = 2 sequence of length 44:
>>
>> [-1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1,
>> -1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, 1,
>> 1, -1, 1, -1]
>>
>> or hopefully:
>>
>> --+++---+++-++--++-+--++---++-+-++-+---++-+-
>>
>> To extend it to a length 45 sequence, with discrepancy D=2
>> if possible, we only need to look at the progressions
>> d, 2d, ... j*d
>>
>> where d is a proper divisor of 45, so this gives us:
>>
>> d = 1,  d = 3, d = 5, d = 9  and d = 15.
> 
> I had that idea too, and I'm running a C program that works like that.
> After about 8 hours it had got a sequence of length 524:
> 
> ++-+--+-++-+--++--+-++-+----+-++-++--++--+-++-+--++--+-+--+++--++-+-+-+--+-+++--+---++-+-++-+---++++-+---+++---++-++---+--+-+-+-+++--+--++-+-+++--+-+--+--++-++-+--++-+--+++-+-+--+--+--++-++-+-+---++-+-+-++---+++--+-+--+-+-++++---++-+--+--++++---+-++-++----+-++++---++-+-++--++-+--++--+--+++-+---+--+-+++-+--++--+-++-+-++--+--++--+-++-+-++---+++---+-++-+--+++---++-++-+--+-+-+--+++--++-+--+--+-+++----+++-+-+--+-++--++-++--+-++-+--+-++--++-+-+---++--+++--++--+-+-++-+---++-+--+++-+--+-++-+--++----+-++--++-++-+--+-++--++-+-++
> 
> But after another 11 hours it hasn't got any further - presumably it's
> having to backtrack a long way.  I doubt it will reach 1160.

Starting from the 524-length sequence with D=2, I spent many hours using
PARI/gp modifiying/toggling/flipping one or many elements, using
various strategies, some pseudo-random , and still haven't found
a length-525 D=2 sequence.

It's almost as if fixing one kind of excessive sum "almost invariably"
leads to a new discrepancy problem, e.g. fixing the d = 9 's can
"break" the d = 3 's, and on and on.

David


> Incidentally, I see that the sequence 0,11,1160 is already in OEIS:
> https://oeis.org/search?q=0%2C11%2C1160&language=english&go=Search
> 
> Here's the code, sadly uncommented:
> 
> /* Find finite sequences with discrepancy <= C */
> 
> #include <stdio.h>
> #include <stdlib.h>




-- 
pub   4096R/41C769D6 2014-11-04
uid                  David Bernier (doubledeckerpot5)
<david250@videotron.ca>

[toc] | [prev] | [next] | [standalone]


#334408

FromDavid Bernier <david250@videotron.ca>
Date2016-05-21 05:11 -0400
Message-ID<nhp8gh$olr$1@dont-email.me>
In reply to#334407
On 05/21/2016 04:01 AM, David Bernier wrote:
> On 05/20/2016 04:03 AM, Richard Tobin wrote:
>> In article <nhmb6e$2md$1@dont-email.me>,
>> David Bernier  <david250@videotron.ca> wrote:
>>
>>> I first obtained a D=2 sequence of length 33, and then I used PARI/gp to
>>> extend it manually, arriving at a D = 2 sequence of length 44:
>>>
>>> [-1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1,
>>> -1, -1, 1, 1, -1, -1, -1, 1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, 1,
>>> 1, -1, 1, -1]
>>>
>>> or hopefully:
>>>
>>> --+++---+++-++--++-+--++---++-+-++-+---++-+-
>>>
>>> To extend it to a length 45 sequence, with discrepancy D=2
>>> if possible, we only need to look at the progressions
>>> d, 2d, ... j*d
>>>
>>> where d is a proper divisor of 45, so this gives us:
>>>
>>> d = 1,  d = 3, d = 5, d = 9  and d = 15.
>>
>> I had that idea too, and I'm running a C program that works like that.
>> After about 8 hours it had got a sequence of length 524:
>>
>> ++-+--+-++-+--++--+-++-+----+-++-++--++--+-++-+--++--+-+--+++--++-+-+-+--+-+++--+---++-+-++-+---++++-+---+++---++-++---+--+-+-+-+++--+--++-+-+++--+-+--+--++-++-+--++-+--+++-+-+--+--+--++-++-+-+---++-+-+-++---+++--+-+--+-+-++++---++-+--+--++++---+-++-++----+-++++---++-+-++--++-+--++--+--+++-+---+--+-+++-+--++--+-++-+-++--+--++--+-++-+-++---+++---+-++-+--+++---++-++-+--+-+-+--+++--++-+--+--+-+++----+++-+-+--+-++--++-++--+-++-+--+-++--++-+-+---++--+++--++--+-+-++-+---++-+--+++-+--+-++-+--++----+-++--++-++-+--+-++--++-+-++
>>
>> But after another 11 hours it hasn't got any further - presumably it's
>> having to backtrack a long way.  I doubt it will reach 1160.
> 
> Starting from the 524-length sequence with D=2, I spent many hours using
> PARI/gp modifiying/toggling/flipping one or many elements, using
> various strategies, some pseudo-random , and still haven't found
> a length-525 D=2 sequence.
> 
> It's almost as if fixing one kind of excessive sum "almost invariably"
> leads to a new discrepancy problem, e.g. fixing the d = 9 's can
> "break" the d = 3 's, and on and on.
> 

I've been running your program, and I noticed there was a long pause
after it found a sequence of length 458 .

Eventually, it did find a solution of length 459.
as it happens, 459 = 9*51 = 9*3*17 = 27x17 .

I wanted to know for how long the sequences agree
completely in the beginning. I find they agree
completely for about the first 57 terms, and after
that it depends. The display is in rows of 27 bits,
except the last which has one fewer bit.

The bit is set to '1' if corresponding terms of same index are
the same, and it is set to '0' if the corresponding terms
from the 458 solution and the 459 solution are different:

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1
1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1
1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1
1 1 1 0 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1
0 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 1 1 0 1
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
0 1 1 0 1 1 1 0 1 1 1 1 0 0 1 0 1 1 1 1 1 1 1 1 1 0 1
0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 1 1 1 1 0 1 0 1 1 1
1 0 0 0 1 1 1 0 0 0 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1
1 0 0 1 1 1 1 1 1 1 1 1 1 1 0 1 1 0 1 1 1 1 1 1 0 0 1
1 1 1 0 0 1 1 1 1 1 1 1 1 0 0 1 1 1 1 0 1 1 0 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1
0 0 1 0 1 0 1 1 1 1 1 0 1 1 1 0 1 1 1 0 1 0 1 1 1 1

Comparison of terms between solutions for
lengths 458 and 459 found by your program.

David Bernier



-- 
pub   4096R/41C769D6 2014-11-04
uid                  David Bernier (doubledeckerpot5)
<david250@videotron.ca>

[toc] | [prev] | [next] | [standalone]


#334409

Fromrichard@cogsci.ed.ac.uk (Richard Tobin)
Date2016-05-21 09:39 +0000
Message-ID<nhpace$9gn$1@macpro.inf.ed.ac.uk>
In reply to#334408
In article <nhp8gh$olr$1@dont-email.me>,
David Bernier  <david250@videotron.ca> wrote:

>I've been running your program, and I noticed there was a long pause
>after it found a sequence of length 458 .
>
>Eventually, it did find a solution of length 459.
>as it happens, 459 = 9*51 = 9*3*17 = 27x17 .
>
>I wanted to know for how long the sequences agree
>completely in the beginning. I find they agree
>completely for about the first 57 terms, and after
>that it depends.

Right, the long delay will be because it was backtracking through the
other 402 terms.  The fact that it takes so long while still leaving
the first 57 unchanged makes it seem unlikely that it can get through
all the combinations in a reasonable length of time.

I've made a modified version of the program that constrains the next
term for each d where possible (e.g. if the sum for d=10 is 2 at
length 100, it constrains s_110 to be -1, and immediately backtracks
if it was already constrained to be +1).  But it's hard to assess
progress as it no longer considers all sequences.

-- Richard

[toc] | [prev] | [next] | [standalone]


#334410

FromDavid Bernier <david250@videotron.ca>
Date2016-05-21 06:58 -0400
Message-ID<nhpeq3$e4t$1@dont-email.me>
In reply to#334409
On 05/21/2016 05:39 AM, Richard Tobin wrote:
> In article <nhp8gh$olr$1@dont-email.me>,
> David Bernier  <david250@videotron.ca> wrote:
> 
>> I've been running your program, and I noticed there was a long pause
>> after it found a sequence of length 458 .
>>
>> Eventually, it did find a solution of length 459.
>> as it happens, 459 = 9*51 = 9*3*17 = 27x17 .
>>
>> I wanted to know for how long the sequences agree
>> completely in the beginning. I find they agree
>> completely for about the first 57 terms, and after
>> that it depends.
> 
> Right, the long delay will be because it was backtracking through the
> other 402 terms.  The fact that it takes so long while still leaving
> the first 57 unchanged makes it seem unlikely that it can get through
> all the combinations in a reasonable length of time.
> 
> I've made a modified version of the program that constrains the next
> term for each d where possible (e.g. if the sum for d=10 is 2 at
> length 100, it constrains s_110 to be -1, and immediately backtracks
> if it was already constrained to be +1).  But it's hard to assess
> progress as it no longer considers all sequences.
> 
> -- Richard
> 

One Polymath project used back-tracking to find long sequences
of discrepancy D = 2.

It's on a web-page:

< http://michaelnielsen.org/polymath1/index.php?title=Depth-first_search >

I compiled it, and it works fines up to length 376,
where for some reason it quits.

Looking at the source code,
in the C pre-processor part,
there's :

#define EXCLUDE \
    ((n%3==0) && (x[n]==x[n/3])) || \
    ((n%5==0) && (x[n]==-x[n/5]))// || \
//    ((n%7==0) && (x[n]==x[n/7]))// || \
//    ((n%11==0) && (x[n]==x[n/11])) || \
//    ((n%13==0) && (x[n]==-x[n/13]))

I removed that   #define   entirely, and also the boolean term
with EXCLUDE in it:
" if ((tot<C_min) || (tot>C_max) || (EXCLUDE)) ok = false; "
of main()

====

The latest entry on-screen is:

length: 790
x:
 +--+-++--+--+-++-++--+-++-++--+-++--+--+-++-++--+-++--+--+-+
 +-++--+-++-+---+-++--+--+-+++-+--+-++--+--+-++-++--+-++-++--
 +-++----++-++--+--+-++--++-+++--++--+--+-++--+-++--++-+-+-++
 ---+-++--++-+-++-+---+-++-++--+-++--+-++-+---++-+-++--+--+-+
 --++--+-++-+++-+--+--+--+-++++---+-++--+--+-++-++---+++-+---
 ++-+--+-++++---+-++--+--+-++-++-++----++-++---+++--+--+++---
 ++-+++--++--+-++-+----+++--++-+-++---+-+-++-++--+-++--+--+++
 --++--+-++-+---+--+-+++--+-+-++-+--++--++---++-++--+-++--+--
 ++++--+--+-++-++--+-++--+---+++--+-++--+++---+-++-++--+-+---
 ++-+-++--+--+-++-++--+-++-++--+-++--+--+-+++----+-++--+-++-+
 +-++--+--+-+++-+----++--+++--+--+-+++--+++---+-++--++-+--++-
 -+++--+-+--+--++-++--++-+-+--+++-+-+---++-+--++--++---+++-++
 ---+-+++--+--++-++--+---++++---++---++-+-+++--++----+++-++--
 -++-+-++-+
verify: pass


I invoked it with:
./a.out script comments

it needs two file-names to write to, and I chose
"script" and "comments" .

David


-- 
pub   4096R/41C769D6 2014-11-04
uid                  David Bernier (doubledeckerpot5)
<david250@videotron.ca>

[toc] | [prev] | [next] | [standalone]


#334303

FromJames Waldby <not@valid.invalid>
Date2016-05-19 04:17 +0000
Message-ID<nhjepi$ssl$1@dont-email.me>
In reply to#334280
On Thu, 19 May 2016 00:11:49 +0000, Richard Tobin wrote:
> Richard Tobin ... wrote:
> 
>>Ok, I see my mistake.  I was using 1, 1+d, 1+2d, ... instead of d, 2d, ...
> 
> After correcting my mistake:
> 
>   ++-+--+-++-+--++--+-++-+----++++--+-+-+-++-
> 
> and
> 
>   ++-+--+-++-+--++--+-++-+----+-++-++-+-+-++--++---+-+-++-++-+---+--+-+++-+--+++--+--++--+++-+----++++

Although I assume I misunderstood the formula and wrote a wrong program,
it does show D=2 for both those sequences.

For your earlier sequences

++-+-+--+--++-+--++-++-+--+--++-++-+--++-+-

and

++-+-+--+--++-+--++-++-+--+--++-+--+-+++-+--+--++-++--++-+-+

it computed D=2 for the first, and D=13 for the other.

Anyhow, my earlier assumption (concept and program being wrong) is 
based on the notion that there should be strings formed of about 
n/2 +1's followed by about n/2 -1's, giving discrepancy 1 or 0, as 
about half of each arithmetically-spaced subsequence will collect 
+1's and half will collect -1's.  

For example, my program says D=1 for each of the following.

n=38  +++++++++++++++++++-------------------
n=42  +++++++++++++++++++++---------------------
n=43  +++++++++++++++++++++----------------------
n=60  ++++++++++++++++++++++++++++++------------------------------
n=100 ++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------

-- 
jiw

[toc] | [prev] | [next] | [standalone]


Page 1 of 3  [1] 2 3  Next page →

Back to top | Article view | sci.math


csiph-web