Timothy -

It becomes more tricky if you want to know what fraction of everything
a host can present that carries 2 or 3 different filters (I mentioned
that somewhere).

For example: everything is 4^4 = 256 options
[ABCD][ABCD][ABCD][ABCD]

Host carries these two filters:
[ABC][AC][AB][ABC]
[ABC][AB][AC][ABC]

Each of these filters can present 36 options, but they overlap on [ABC]
[A][A][ABC] (9 options), so the total they can present is 36 + 36 -
9.



Unless I can logically identify the overlap between all the
combinations of filters that are present within a host (i.e. 1-3, 1-2,
2-3 if I've three filters), and
remove that overlap from one of the filters.. calculating the exact
value is going to be tricky.

Overlap between these:
[AC D][AC][BD][C] (12 options)
[ABC][A][ACD][ABC] (27 options)

is [AC][A][D][C] -> 2 options.

However, I can't just substract the overlap from one of these two
filters..

[D][C][D][C] (1 option)
[ABC][A][ACD][ABC] (27 options)

or

[AC D][AC][BD][C] (12 options)
[B][][D][C] (0 options)

I might try and figure out what I can do, I gave up on this course of
action earlier, but seeing that the brute-force way takes eons, I'll
look into this. This will be an interesting exercise :).





On Dec 29, 1:16 am, Timothy Pratley <timothyprat...@gmail.com> wrote:
> If you aren't interested in the permutations themselves, just the
> number of them (if I read you right)....
>
> > The only way I could think up to know exactly what
> > fraction of the optimum (2x 5%: remember the diploidi)) a set of
> > combined filters can present is by expanding these filters into a set
> > of all possible strings that they can present, and counting this set.
> > (count (expand (first myset))))
>
> Then there is no real need to generate them at all:
> user=> (reduce * (map count [[1 2 3] [3 4]]))
> 6
>
> Regards,
> Tim.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to