Is there an ordering of integers with maximum near equal spacing between integers of the same set bit count? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)Why is the set of integers with the operation of addition considered a cyclic group?In how many ways can the integers from $1$ to $n$ be divided into two groups with the same sum?is it possible to count the number of rational numbers there are between any two integers?Is there a deeper reason for this relationship between the integers and the algebraic closure of a finite field?Two integers with the same sinus(Inverse) mapping from $mathbbR$ to subsets of $mathbbN$Proving the maximum of a set of integers defined on an interval (a,b) where b is not an integerRestricted partition of integer: strictly k distinct parts from a setWhen extending the natural numbers to the integers when is it legal to set a natural number equal to an integer.Is there utility in a boolean function that flags the set of integers?

Question about debouncing - delay of state change

What's the meaning of "fortified infraction restraint"?

AppleTVs create a chatty alternate WiFi network

What is the difference between globalisation and imperialism?

Take 2! Is this homebrew Lady of Pain warlock patron balanced?

Chinese Seal on silk painting - what does it mean?

Why should I vote and accept answers?

What is a fractional matching?

Putting class ranking in CV, but against dept guidelines

How do I find out the mythology and history of my Fortress?

How could we fake a moon landing now?

How to tell that you are a giant?

Amount of permutations on an NxNxN Rubik's Cube

Did Deadpool rescue all of the X-Force?

Why is my ESD wriststrap failing with nitrile gloves on?

How can I reduce the gap between left and right of cdot with a macro?

Time to Settle Down!

Performance gap between vector<bool> and array

When a candle burns, why does the top of wick glow if bottom of flame is hottest?

Is it fair for a professor to grade us on the possession of past papers?

Did Krishna say in Bhagavad Gita "I am in every living being"

What is this clumpy 20-30cm high yellow-flowered plant?

Maximum summed subsequences with non-adjacent items

Why do we bend a book to keep it straight?



Is there an ordering of integers with maximum near equal spacing between integers of the same set bit count?



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)Why is the set of integers with the operation of addition considered a cyclic group?In how many ways can the integers from $1$ to $n$ be divided into two groups with the same sum?is it possible to count the number of rational numbers there are between any two integers?Is there a deeper reason for this relationship between the integers and the algebraic closure of a finite field?Two integers with the same sinus(Inverse) mapping from $mathbbR$ to subsets of $mathbbN$Proving the maximum of a set of integers defined on an interval (a,b) where b is not an integerRestricted partition of integer: strictly k distinct parts from a setWhen extending the natural numbers to the integers when is it legal to set a natural number equal to an integer.Is there utility in a boolean function that flags the set of integers?










0












$begingroup$


Let $n$ be a whole number, and $mathcalS_n$ be an ordered list of integers from 0 to $2^n-1$, does there exist an ordering $mathcalD_n$ of $mathcalS_n$ such that the distance between integers with the same bit set count in $mathcalD_n$ is nearly consecutive (e.i. equal spaced), maximized, and the rules of constructing $mathcalD_n$ are known?



For example given $mathcalS_3=000_2,001_2,010_2,011_2,100_2,101_2,110_2,111_2$ in binary form, let $textbitcnt()$ count the number of set bits, then $textbitcnt(mathcalS_3)=0,1,1,2,1,2,2,3$. One could construct $mathcalD_3=000_2,111_2,001_2,110_2,010_2,101_2,100_2,011_2$ where pairs of integers are adjacent if they are set bit inverses of each other (e.i. ~$(000_2)=111_2$), which leads to consecutive spacing of integers with one set bit as $001_2-(1)-010_2-(1)-100_2$, and with two set bits $110_2-(1)-101_2-(1)-011_2$, where $a-(x)-b$ means $x$ integers are placed in between $a$ and $b$.



The trivial case of ordering by set bit count is by sorting all elements of set bit count, where all integers of the same bit set count are grouped together with zero spacing between them. The non-trivial case is when the spacing is maximum such that no two elements of the same bit set count are next to each other.










share|cite|improve this question











$endgroup$











  • $begingroup$
    " distance between integers with the same bit set count ... is nearly consecutive " sounds confusing to me. You mean that the binary numbers with a given fixed weight are approximately equispaced, no?
    $endgroup$
    – leonbloy
    Apr 1 at 17:07










  • $begingroup$
    Why not just sort the integers by their bit counts? A run of consecutive elements in a list is certainly equally spaced.
    $endgroup$
    – Greg Martin
    Apr 1 at 17:08










  • $begingroup$
    @GregMartin that is a good point. Your suggestion is the trivial case. I need to modify my questions to be more specific where the integers of the same bit set count are not grouped together, but are also spread equally across the entire list with maximum spacing.
    $endgroup$
    – linuxfreebird
    Apr 1 at 17:11










  • $begingroup$
    @leonbloy I am unsure of what you are asking me. Do you want me to define set bit count as a fixed weight?
    $endgroup$
    – linuxfreebird
    Apr 1 at 17:16















0












$begingroup$


Let $n$ be a whole number, and $mathcalS_n$ be an ordered list of integers from 0 to $2^n-1$, does there exist an ordering $mathcalD_n$ of $mathcalS_n$ such that the distance between integers with the same bit set count in $mathcalD_n$ is nearly consecutive (e.i. equal spaced), maximized, and the rules of constructing $mathcalD_n$ are known?



For example given $mathcalS_3=000_2,001_2,010_2,011_2,100_2,101_2,110_2,111_2$ in binary form, let $textbitcnt()$ count the number of set bits, then $textbitcnt(mathcalS_3)=0,1,1,2,1,2,2,3$. One could construct $mathcalD_3=000_2,111_2,001_2,110_2,010_2,101_2,100_2,011_2$ where pairs of integers are adjacent if they are set bit inverses of each other (e.i. ~$(000_2)=111_2$), which leads to consecutive spacing of integers with one set bit as $001_2-(1)-010_2-(1)-100_2$, and with two set bits $110_2-(1)-101_2-(1)-011_2$, where $a-(x)-b$ means $x$ integers are placed in between $a$ and $b$.



The trivial case of ordering by set bit count is by sorting all elements of set bit count, where all integers of the same bit set count are grouped together with zero spacing between them. The non-trivial case is when the spacing is maximum such that no two elements of the same bit set count are next to each other.










share|cite|improve this question











$endgroup$











  • $begingroup$
    " distance between integers with the same bit set count ... is nearly consecutive " sounds confusing to me. You mean that the binary numbers with a given fixed weight are approximately equispaced, no?
    $endgroup$
    – leonbloy
    Apr 1 at 17:07










  • $begingroup$
    Why not just sort the integers by their bit counts? A run of consecutive elements in a list is certainly equally spaced.
    $endgroup$
    – Greg Martin
    Apr 1 at 17:08










  • $begingroup$
    @GregMartin that is a good point. Your suggestion is the trivial case. I need to modify my questions to be more specific where the integers of the same bit set count are not grouped together, but are also spread equally across the entire list with maximum spacing.
    $endgroup$
    – linuxfreebird
    Apr 1 at 17:11










  • $begingroup$
    @leonbloy I am unsure of what you are asking me. Do you want me to define set bit count as a fixed weight?
    $endgroup$
    – linuxfreebird
    Apr 1 at 17:16













0












0








0





$begingroup$


Let $n$ be a whole number, and $mathcalS_n$ be an ordered list of integers from 0 to $2^n-1$, does there exist an ordering $mathcalD_n$ of $mathcalS_n$ such that the distance between integers with the same bit set count in $mathcalD_n$ is nearly consecutive (e.i. equal spaced), maximized, and the rules of constructing $mathcalD_n$ are known?



For example given $mathcalS_3=000_2,001_2,010_2,011_2,100_2,101_2,110_2,111_2$ in binary form, let $textbitcnt()$ count the number of set bits, then $textbitcnt(mathcalS_3)=0,1,1,2,1,2,2,3$. One could construct $mathcalD_3=000_2,111_2,001_2,110_2,010_2,101_2,100_2,011_2$ where pairs of integers are adjacent if they are set bit inverses of each other (e.i. ~$(000_2)=111_2$), which leads to consecutive spacing of integers with one set bit as $001_2-(1)-010_2-(1)-100_2$, and with two set bits $110_2-(1)-101_2-(1)-011_2$, where $a-(x)-b$ means $x$ integers are placed in between $a$ and $b$.



The trivial case of ordering by set bit count is by sorting all elements of set bit count, where all integers of the same bit set count are grouped together with zero spacing between them. The non-trivial case is when the spacing is maximum such that no two elements of the same bit set count are next to each other.










share|cite|improve this question











$endgroup$




Let $n$ be a whole number, and $mathcalS_n$ be an ordered list of integers from 0 to $2^n-1$, does there exist an ordering $mathcalD_n$ of $mathcalS_n$ such that the distance between integers with the same bit set count in $mathcalD_n$ is nearly consecutive (e.i. equal spaced), maximized, and the rules of constructing $mathcalD_n$ are known?



For example given $mathcalS_3=000_2,001_2,010_2,011_2,100_2,101_2,110_2,111_2$ in binary form, let $textbitcnt()$ count the number of set bits, then $textbitcnt(mathcalS_3)=0,1,1,2,1,2,2,3$. One could construct $mathcalD_3=000_2,111_2,001_2,110_2,010_2,101_2,100_2,011_2$ where pairs of integers are adjacent if they are set bit inverses of each other (e.i. ~$(000_2)=111_2$), which leads to consecutive spacing of integers with one set bit as $001_2-(1)-010_2-(1)-100_2$, and with two set bits $110_2-(1)-101_2-(1)-011_2$, where $a-(x)-b$ means $x$ integers are placed in between $a$ and $b$.



The trivial case of ordering by set bit count is by sorting all elements of set bit count, where all integers of the same bit set count are grouped together with zero spacing between them. The non-trivial case is when the spacing is maximum such that no two elements of the same bit set count are next to each other.







integers






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Apr 1 at 17:48









Bernard

124k742117




124k742117










asked Apr 1 at 16:50









linuxfreebirdlinuxfreebird

33419




33419











  • $begingroup$
    " distance between integers with the same bit set count ... is nearly consecutive " sounds confusing to me. You mean that the binary numbers with a given fixed weight are approximately equispaced, no?
    $endgroup$
    – leonbloy
    Apr 1 at 17:07










  • $begingroup$
    Why not just sort the integers by their bit counts? A run of consecutive elements in a list is certainly equally spaced.
    $endgroup$
    – Greg Martin
    Apr 1 at 17:08










  • $begingroup$
    @GregMartin that is a good point. Your suggestion is the trivial case. I need to modify my questions to be more specific where the integers of the same bit set count are not grouped together, but are also spread equally across the entire list with maximum spacing.
    $endgroup$
    – linuxfreebird
    Apr 1 at 17:11










  • $begingroup$
    @leonbloy I am unsure of what you are asking me. Do you want me to define set bit count as a fixed weight?
    $endgroup$
    – linuxfreebird
    Apr 1 at 17:16
















  • $begingroup$
    " distance between integers with the same bit set count ... is nearly consecutive " sounds confusing to me. You mean that the binary numbers with a given fixed weight are approximately equispaced, no?
    $endgroup$
    – leonbloy
    Apr 1 at 17:07










  • $begingroup$
    Why not just sort the integers by their bit counts? A run of consecutive elements in a list is certainly equally spaced.
    $endgroup$
    – Greg Martin
    Apr 1 at 17:08










  • $begingroup$
    @GregMartin that is a good point. Your suggestion is the trivial case. I need to modify my questions to be more specific where the integers of the same bit set count are not grouped together, but are also spread equally across the entire list with maximum spacing.
    $endgroup$
    – linuxfreebird
    Apr 1 at 17:11










  • $begingroup$
    @leonbloy I am unsure of what you are asking me. Do you want me to define set bit count as a fixed weight?
    $endgroup$
    – linuxfreebird
    Apr 1 at 17:16















$begingroup$
" distance between integers with the same bit set count ... is nearly consecutive " sounds confusing to me. You mean that the binary numbers with a given fixed weight are approximately equispaced, no?
$endgroup$
– leonbloy
Apr 1 at 17:07




$begingroup$
" distance between integers with the same bit set count ... is nearly consecutive " sounds confusing to me. You mean that the binary numbers with a given fixed weight are approximately equispaced, no?
$endgroup$
– leonbloy
Apr 1 at 17:07












$begingroup$
Why not just sort the integers by their bit counts? A run of consecutive elements in a list is certainly equally spaced.
$endgroup$
– Greg Martin
Apr 1 at 17:08




$begingroup$
Why not just sort the integers by their bit counts? A run of consecutive elements in a list is certainly equally spaced.
$endgroup$
– Greg Martin
Apr 1 at 17:08












$begingroup$
@GregMartin that is a good point. Your suggestion is the trivial case. I need to modify my questions to be more specific where the integers of the same bit set count are not grouped together, but are also spread equally across the entire list with maximum spacing.
$endgroup$
– linuxfreebird
Apr 1 at 17:11




$begingroup$
@GregMartin that is a good point. Your suggestion is the trivial case. I need to modify my questions to be more specific where the integers of the same bit set count are not grouped together, but are also spread equally across the entire list with maximum spacing.
$endgroup$
– linuxfreebird
Apr 1 at 17:11












$begingroup$
@leonbloy I am unsure of what you are asking me. Do you want me to define set bit count as a fixed weight?
$endgroup$
– linuxfreebird
Apr 1 at 17:16




$begingroup$
@leonbloy I am unsure of what you are asking me. Do you want me to define set bit count as a fixed weight?
$endgroup$
– linuxfreebird
Apr 1 at 17:16










1 Answer
1






active

oldest

votes


















0












$begingroup$

If $n$ is even, there are $n choose n/2=frac n!(n/2)!^2approx frac 2^nsqrtpi n/2$ with half the bits set. The best spacing you can get is then $sqrt pi n/2$ for those. For $n=20$ the exact value is $5.6$ so you can keep them $5$ positions apart. A simple approach is to scatter the numbers with half the bits set as evenly as possible, then put the ones with one extra bit set in the next locations and one less bit set in the previous locations. You can keep going with this spacing and will have room left for the ones farther from balanced.






share|cite|improve this answer









$endgroup$













    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "69"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    noCode: true, onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3170842%2fis-there-an-ordering-of-integers-with-maximum-near-equal-spacing-between-integer%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0












    $begingroup$

    If $n$ is even, there are $n choose n/2=frac n!(n/2)!^2approx frac 2^nsqrtpi n/2$ with half the bits set. The best spacing you can get is then $sqrt pi n/2$ for those. For $n=20$ the exact value is $5.6$ so you can keep them $5$ positions apart. A simple approach is to scatter the numbers with half the bits set as evenly as possible, then put the ones with one extra bit set in the next locations and one less bit set in the previous locations. You can keep going with this spacing and will have room left for the ones farther from balanced.






    share|cite|improve this answer









    $endgroup$

















      0












      $begingroup$

      If $n$ is even, there are $n choose n/2=frac n!(n/2)!^2approx frac 2^nsqrtpi n/2$ with half the bits set. The best spacing you can get is then $sqrt pi n/2$ for those. For $n=20$ the exact value is $5.6$ so you can keep them $5$ positions apart. A simple approach is to scatter the numbers with half the bits set as evenly as possible, then put the ones with one extra bit set in the next locations and one less bit set in the previous locations. You can keep going with this spacing and will have room left for the ones farther from balanced.






      share|cite|improve this answer









      $endgroup$















        0












        0








        0





        $begingroup$

        If $n$ is even, there are $n choose n/2=frac n!(n/2)!^2approx frac 2^nsqrtpi n/2$ with half the bits set. The best spacing you can get is then $sqrt pi n/2$ for those. For $n=20$ the exact value is $5.6$ so you can keep them $5$ positions apart. A simple approach is to scatter the numbers with half the bits set as evenly as possible, then put the ones with one extra bit set in the next locations and one less bit set in the previous locations. You can keep going with this spacing and will have room left for the ones farther from balanced.






        share|cite|improve this answer









        $endgroup$



        If $n$ is even, there are $n choose n/2=frac n!(n/2)!^2approx frac 2^nsqrtpi n/2$ with half the bits set. The best spacing you can get is then $sqrt pi n/2$ for those. For $n=20$ the exact value is $5.6$ so you can keep them $5$ positions apart. A simple approach is to scatter the numbers with half the bits set as evenly as possible, then put the ones with one extra bit set in the next locations and one less bit set in the previous locations. You can keep going with this spacing and will have room left for the ones farther from balanced.







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Apr 1 at 18:16









        Ross MillikanRoss Millikan

        302k24200375




        302k24200375



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Mathematics Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            Use MathJax to format equations. MathJax reference.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3170842%2fis-there-an-ordering-of-integers-with-maximum-near-equal-spacing-between-integer%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Boston (Lincolnshire) Stedsbyld | Berne yn Boston | NavigaasjemenuBoston Borough CouncilBoston, Lincolnshire

            Trouble understanding the speech of overseas colleaguesHow can I better understand manager or clients with strong accents?Adding more movement and speech at the fundamental level to a highly-sedentary job?Difficulty in understanding Manager's accent(language and communication)How to adjust yourself where your colleagues are not understanding to you?Understanding manager's expectationsForeigner and colleagues using slangHaving difficulty understanding meetingsHow do you breathe when giving a speech?Trouble Waking Up for Emergencies (On-Call)Problems with colleaguesColleagues feeling insecure when I do my work

            Ballerup Komuun Stääden an saarpen | Futnuuten | Luke uk diar | Nawigatsjuunwww.ballerup.dkwww.statistikbanken.dk: Tabelle BEF44 (Folketal pr. 1. januar fordelt på byer)Commonskategorii: Ballerup Komuun55° 44′ N, 12° 22′ O