Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>While the problem looks quite simple it could be related to the NP-complete <a href="http://en.wikipedia.org/wiki/Set_cover_problem" rel="nofollow noreferrer">Set Cover Problem</a>. So it could be possible that there is no efficent way to detect valid combinations, hence no efficent way to count them.</p> <p><strong>UPDATE</strong></p> <p>I thought about the list items beeing pairs because it seems to make the problem harder to attack - you have to check two properties for one item. So I looked for a way to reduce the pair to a scalar item and found a way.</p> <p>Map the set of the <code>n</code> symbols to the set of the first <code>n</code> primes - I will call this function <code>M</code>. In the case of the symbols <code>0</code> to <code>9</code> we obtain the following mapping and <code>M(4) = 11</code> for example.</p> <pre><code>{0, 1, 2, 3, 4, 5, 6, 7, 8, 9} =&gt; {2, 3, 5, 7, 11, 13, 17, 19, 23, 29} </code></pre> <p>Now we can map a pair <code>(n, m)</code> using the mapping X to the product of the mappings of <code>n</code> and <code>m</code>. This will turn the pair <code>(2, 5)</code> into <code>X((2, 5)) = M(2) * M(5) = 5 * 13 = 65</code>.</p> <pre><code>X((n, m)) = M(n) * M(m) </code></pre> <p>Why all this? If we have two pairs <code>(a, b)</code> and <code>(c, d)</code> from two lists, map them using the mapping <code>X</code> to <code>x</code> and <code>y</code> and multiply them, we obtain the product <code>x * y = M(a) * M(b) * M(c) * M(d)</code> - a product of four primes. We can extend the product by more factors by selecting a pair from each list and obtain a product of <code>2w</code> primes if we have <code>w</code> lists. The final question is what does this product tell us about the pairs we selected and multiplied? If the selected pairs form a valid selection, we never choose one symbol twice, hence the product contains no prime twice and is <a href="http://en.wikipedia.org/wiki/Square-free_integer" rel="nofollow noreferrer">square free</a>. If the selection is invalid the product contains at least one prime twice and is not square free. And here a final example.</p> <pre><code>X((2, 5)) = 5 * 13 = 65 X((3, 6)) = 7 * 17 = 119 X((3, 4)) = 7 * 11 = 77 </code></pre> <p>Selecting <code>25</code> and <code>36</code> yields <code>65 * 119 = 7735 = 5 * 7 * 13 * 17</code> and is square free, hence valid. Selecting <code>36</code> and <code>34</code> yields <code>119 * 77 = 9163 = 7² * 11 * 17</code> and is not square free, hence not valid.</p> <p>Also note how nicely this preserves the symmetrie - X((m, n)) = X((n, m)) - and prohibites symmetric pairs because <code>X((m, m)) = M(m) * M(m)</code> is not square free.</p> <p>I don't know if this will be any help, but now you know it and can think about it...^^</p> <hr> <p>This is the first part of an reduction of a 3-SAT problem to this problem. The 3-SET problem is the following.</p> <pre><code>(!A | B | C) &amp; (B | !C | !D) &amp; (A | !B) </code></pre> <p>And here is the reduction as far as I got.</p> <ul> <li>m-n represents a pair</li> <li>a line reprresents a list</li> <li>an asterisk represents an abitrary unique symbol </li> </ul> <hr> <pre><code>A1-A1' !A1-!A1' =&gt; Select A true or false B1-B1' !B1-!B1' =&gt; Select B true or false C1-C1' !C1-!C1' =&gt; Select C true or false D1-D1' !D1-!D1' =&gt; Select D true or false A1-* !B1-* !C1-* =&gt; !A | B | C A2-!A1' !A2-A1' =&gt; Create a copy of A B2-!B1' !B2-B1' =&gt; Create a copy of B C2-!C1' !C2-C1' =&gt; Create a copy of C D2-!D1' !D2-D1' =&gt; Create a copy of D !B2-* C2-* D2-* =&gt; B | !C | !D (How to perform a second copy of the four variables???) !A3-* B3-* </code></pre> <p>If I (or somebody else) can complete this reduction and show how to do it in the general case, this will proof the problem NP-complete. I am just stuck with copying the variables a second time.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload