Questions tagged [subset]

Questions on the usage of the Subsets command and related functionalities (Tuples, Permutations etc.), and on how to implement more efficient algorithms.

37 questions
Filter by
Sorted by
Tagged with
55 views

Simple way to decompose a lists in a certain way?

I want to decompose one list into sublists (each sublist is given by certain lengh and the sum of every sublist is given by the maximun number in lists). For ...
37 views

Creating pairs of non-intersecting set from a given set

Let's say I have a set {a,b,c,d} and I want to create a list of pairs {{a,b,c,d},{}},{{a,b,c},{d}},{{a,b,c},{}},... such that there is no intersection between each pair, and they do not need to use ...
29 views

How to find disjoint subsets such that union of the sets give the motherset or main set?

Let us define a set $\mathcal{S}=\{1,2, 3,\cdots,67\}$. I have a list of 132 subsets. I want to obtain 16(or 17) mutually exclusive subsets such that union of such 16(or 17) is equal to $\mathcal{S}$...
55 views

Generating all possible subgraphs from an adjacency matrix

I have an adjacency matrix given by am. I want to generate all possible subgraphs with 6 nodes. Here is the code I am using to generate them. But, I am getting some error: ...
47 views

Calculate plausibility in Dempster-Shafer theory

I want to use Mathematica to show which subsets of a power set are required to calculate the plausibility for a given set in a power set. This has lead me to compute a summation with a ...
110 views

Generate list of tuples, modulo PermutationGroup

I have a permutation group, e.g. g = PermutationGroup[{Cycles[{{1, 2}}]}] but not necessarily limited to a single generating cycle. What I want is to create a ...
59 views

Iterating over pairs in a list

Take a look at this code: ...
51 views

Delete duplicates and sort a list of sets separately? [closed]

I have a set where it has three subsets. I want to have each element of each subsets appears only once, sorted, but the order of subsets does not change. For example: I want to get from  \{\{5,2,2,3\...
202 views

Subsets of a multiset

The function Subsets[] returns the subsets of a finite set of elements. This function has a shortcoming in that it treats repeated elements distinctively. Is there ...
87 views

Finding maximal elements of partially ordered sets

I am dealing with partially ordered sets $\Gamma$, which I represent as directed graphs with an edge going from $a$ to $b$ if $a \leq b$ in $\Gamma$. For example the following graph, ...
454 views

Summation over integers satisfying some conditions

$n$ is a fixed positive integer and $p$ is the largest prime $\le n$: p = Prime[PrimePi[n]] For each subset $L$ of positive composite integers less than or ...
178 views

Creating subsets of lists of lists which have certain properties

PREFACE: This question is about a proper algorithm and its implementation. I will explain the problem as detailed as possible and will give my current algorithm as well as two more possible solutions ...
49 views

determine the structure of Data in sum of two subsets Modulus $n$

I wrote a code below to determine the cases when two subsets of a set $\mathbb{Z_n}=\{0,1,2,\ldots,n-1\}$ are added together element by element (without removing the multiplicity) in $\mathbb{Z_n}$ ...
769 views

Is there concise code for the list operation I want to perform?

Is there any concise syntax for the following partitioning of a list. Given {1, 2, 3, 4}, I want to get the output as shown below. I have tried various function ...
74 views

324 views

How to subset datasets in Mathematica 10 [closed]

I'm sorry if this is obvious but I can't find a way to select only a certain amount of columns of a dataset (or delete a certain amount of columns from a dataset) using the key of each column. I ...
113 views

Efficient subsetting and averaging

The following code aims to average 4 groups of the values vector. Which elements belong to each group is determined by the indic ...
Given {a, b, c, ...} with $n$ elements generate a list with $2^n$ elements. For example, if the list were {a, b, c}, then the ...