# Questions tagged [sets]

For questions pertaining to sets in the set-theoretical sense. Use "assignment" for questions about the use of the Mathematica functions Set or SetDelayed.

92 questions
Filter by
Sorted by
Tagged with
137 views

### How can one expand an arbitrary boolean combination into the $2^n$ atoms of the associated boolean algebra of size $2^{2^n}$?

The answer of user250938 to Can one usefully apply the Boolean functions of Mathematica to measurable Boolean sets? and the second comment of Monroe Eskew to the answer to https://mathoverflow.net/...
11 views

### Is “A = {x | (x, y) ∈ A}” the same thing of “dom A”? [migrated]

I am learning set theory using the book "Axioms and Set Theory" from Robert André and it defines dom R as dom R = {x : x∈C ∧ (x, y) ∈ R for some x∈C}, R is a relation on C. But English ain't my first ...
72 views

### Can one usefully apply the Boolean functions of Mathematica to measurable Boolean sets?

This is something of an attempted succinct/pointed rephrasing of an earlier question Given measures on sets and on certain Boolean combinations of the sets, can one check their consistency and/or ...
32 views

### Given measures on sets and on certain Boolean combinations of the sets, can one check their consistency and/or extend them to other combinations?

I have four sets--let us denote them $A_i, i=1,\ldots,4$--of quantum-information-theoretic interest (https://arxiv.org/abs/2004.06745, https://arxiv.org/abs/1905.09228). The set $A_1$ contains the ...
3k views

### Putting set elements into venn diagram

My problem has two parts. Before that I have two Lists/Sets. It suppose to be created them by two initial strings. In the first part, I need to show sets' elements in venn diagram. I can create venn ...
79 views

### every set intersection for every set in a family with another family of sets

I want to find for each list within a list of lists what intersections occur when taking set intersection for each list in another list of lists. Hopefully that makes sense. I have tried ...
725 views

### How to randomly select subsets

I have a list of around 300 elements. I want to sample subsets of length 25 such that my samples are all distinct. My first inclination was to use something like ...
4 views

### Assigning a solution to variables [duplicate]

I have solved my solution and it has been appeared, it is C1, C2, C3, C4 but when I call C1 again (%13), program shows me that C1,... is not assigned. How can I reapair that ?
2k views

### How to make an efficient difference of sets function?

How to write a nice code that removes all elements from given set A, that occur also in set B? I would like to use DeleteCases[] for this purpose, but have no good ...
448 views

### Delete sublist when sub-sublists contain same element

Given lis={{{a},{b,c,d}},{{a,b},{b,c}},{{b,c},{a,b,c}},{{b},{d}},{{a,b},{c,d}}} I want to delete sublists which have one or more elements in common. So that I ...
788 views

### How to stretch this Venn diagram?

I am trying to duplicate (approximately) the following Venn diagram in Mathematica: I have used the top of this page as a guide, which showcases the following Venn diagram triplet: ...
60 views

### ArgMin over intervals and discrete sets

I was playing with ArgMin but I'm not sure how to use it for constrained optimization. For example, ArgMin[x^2, x] returns <...
58 views

61 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\...
2k views

### how to efficiently apply function to all pairs of a set (and collect the results)

To build a graph, I need to apply a function f[a_, b_] to all pairs of a list (3500 elements). The function itself returns a link ...
517 views

### Is there a simple way to perform the opposite of intersection on two lists?

By "opposite of intersection" I mean that if I have two lists like so: list1 = {1,2,4,7,9}; list2 = {1,4,9,10,11} And then we do the "Reverse Intersection" on ...
59 views

### How do I simplify operations on sets?

How would I use Mathematica to simplify: S'∩(S∪T')' The answer is S'∩T Edit: S' means Complement of S. Thanks! Solved with: BooleanConvert[! S && ! (S || ! T)]
40 views

### Set of order preserving functions

I have a partial order defined on a finite set, 13 elements, represented as a directed graph. I'm trying to work with the set of order preserving functions from this poset into a finite subset of the ...
106 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, ...
253 views

### Finding largest Range in a list

In a list of positive integers, I would like to find the largest n such that Range[n] is a subset of the list. So for example ...
945 views

### Any built-in function to generate successive sublists from a list?

Given lst = {a, b, c, d} I'd like to generate {{a}, {a, b}, {a, b, c}, {a, b, c, d}} but using built-in functions only, ...
477 views

### Patternmatching sets

How to match set-patterns against sets? A set (in the mathematical sense) is a list of elements without repetition and order of elements does not matter. For example, we have a pattern set ...
117 views

...
1k views

### Enumerating tuples from a larger space such that all pairs of values are present at least once

I am trying to write a function that will accept a list of N lists and returns a list of N-tuples that represent all pairs of values from the original N lists at least once. To illustrate with an ...
127 views

### Partition a set of n objects into k subsets? [duplicate]

Is there some function recently added to Mathematica that facilitates forming all partitions of a n-element set into k subsets? In other words, something that easily gives the same thing as what <...
61 views

### If I have numbered elements, I there a simple way to put them in a list? [duplicate]

I've defined manually 32 elements as w1, w2, w3,..., w32....