Re: [R] Help to write the R-code, please

2019-12-06 Thread Martin Maechler
> Richard O'Keefe > on Fri, 6 Dec 2019 12:18:50 +1300 writes: > This particular task is not a problem about R. > It is a problem n combinatorics. > Start with the obvious brute force algorithm > (1) Let S be the union of all the sets > (2) For each K in 0 .. |S|

Re: [R] Help to write the R-code, please

2019-12-05 Thread Richard O'Keefe
This particular task is not a problem about R. It is a problem n combinatorics. Start with the obvious brute force algorithm (1) Let S be the union of all the sets (2) For each K in 0 .. |S| (3) Enumerate all |S| choose K subsets C of S (4) If C satisfies the condition, report it and stop (5)

Re: [R] Help to write the R-code, please

2019-12-05 Thread Ivan Krylov
It might be easier to implement in R if you employ the base functions that take arrays and operate on them as if they represented sets. See the help() for "union", "intersect", "setdiff", "setequal" and the operator "%in%". -- Best regards, Ivan __ R-h

Re: [R] Help to write the R-code, please

2019-12-05 Thread Jeff Newmiller
On December 5, 2019 3:39:07 AM PST, "Александр Дубровский" wrote: >Task: >A family of sets of letters is given. Find K for which one can >construct a >set consisting of K letters, each of them belonging to exactly K sets >of a >given family. ... > > [[alternative HTML version deleted]]

[R] Help to write the R-code, please

2019-12-05 Thread Александр Дубровский
Task: A family of sets of letters is given. Find K for which one can construct a set consisting of K letters, each of them belonging to exactly K sets of a given family. Possible solution: For each letter, we will have a separate 'scoop', in which we will' put ' the letter. This can be done using