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

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

Replies are listed 'Best First'.
Re^6: Speeding permutation counting
by BrowserUk (Patriarch) on Jul 20, 2007 at 00:19 UTC

    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