in reply to Re^3: Speeding permutation counting
in thread Speeding permutation counting

Oh. I see what you mean.

Eg. If of 1000 strings, 500 have a 1 in bit 0, then you know that in the 500500 2-way compares, you would get '00' & '11' 1/4 of the time each and '01' or '10' 1/2 of the time.

But I don't see a way of determining how many '10's relative to the '01's?

And no way to determine which pairs of strings render which values for any given bit, nor a count of the four possible values for any given pair of strings?


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re^5: Speeding permutation counting
by Limbic~Region (Chancellor) on Jul 20, 2007 at 00:08 UTC
    BrowserUk,
    I am likely misunderstanding the problem. For the sake of simplicity, I am using strings of 1 character. Do I have the correct output for the provided input?
    string 1: 0 string 2: 1 string 3: 0 string 4: 1 string 5: 0 1 & 2 -> 01 10 1 & 3 -> 00 00 1 & 4 -> 01 10 1 & 5 -> 00 00 2 & 3 -> 10 01 2 & 4 -> 11 11 2 & 5 -> 10 01 3 & 4 -> 01 10 3 & 5 -> 00 00 4 & 5 -> 10 01 Totals 01 = 6 10 = 6 11 = 2 00 = 6
    If that is correct, then I think my math approach will work.

    Cheers - L~R

      What the OP is calculating is the number of bit pairing (4 values) for each combination of 2 strings.

      Eg: Assuming 32-bit strings, typical values might be:

      strings: '00' '01' '10' '11' 1 & 2 10 5 12 15 1 & 3 2 17 7 6 1 & 4 1 & 5 2 & 3 ....

      So the OP wants 4 numbers per pairing of strings, regardless of the number of bits.

      What you would be calculating is 4 numbers per bit position, regardless of the number of strings.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
        BrowserUk,
        See, I told you I was misunderstanding the problem ;-)

        Cheers - L~R