Questions tagged [tuples]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
57 views

How can I solve the issue of insufficient memory when dealing with large tuples?

How can I solve the issue of insufficient memory when dealing with large tuples? For example,consider the following example: Tuples[{1, 2, 3}, 25]
internet's user avatar
  • 817
3 votes
2 answers
149 views

How to find repeating elements in the following grid?

Consider the following table: ...
John Taylor's user avatar
  • 5,733
0 votes
1 answer
72 views

A simpler way of identifying which elements of Tuples[{0,1,2,3},6] multiply with each of my codewords to give zero?

So I have a list of codewords. The codewords have length 64, so there are 64 codewords in my code. My code is over an alphabet of 4 (the code can be thought of as having four elements $0,1,2,3$ and ...
am567's user avatar
  • 501
5 votes
3 answers
186 views

How to create all $1$'s vectors of length $n$ without using Tuples[]? [closed]

I am having problems with creating a vector of 1s of length (for example) n=4. I tried ones=Tuples[{1},4] This outputs {{$1,1,1,1$}} The problem I have here, is ...
am567's user avatar
  • 501
1 vote
2 answers
64 views

Dynamic function using combinations (Tuples?) of vector elements

I have two vectors p={p1,p2,...,pK} and q={q1,q2,...,qK} of size K. I would like to create a function which is dynamic in the sense that its definition depends on K because it uses all cross-terms (...
sg1234's user avatar
  • 289
1 vote
2 answers
124 views

How to have index of summation equal to all $n$-tuples $\left(b_i\right)_{i\le n}$ with $\sum ib_i = n$ and $b_j$ fixed?

Let $T_n$ denote the set of $n$-tuples $\left(b_1, \ldots, b_n \right)$ of non-negative integers such that $$\sum_{i=1}^{n}ib_i=n.$$ I am trying to simplify the sum (whose indicies depend solely on $n,...
The Substitute's user avatar
3 votes
4 answers
248 views

Working with tables: add new level of nested tables

I am trying to obtain all possible combinations of elements in a (long) list factors = {A, B, C}; getCombinations[factors,n] For n = 3 factors, it should give <...
Albercoc's user avatar
  • 988
2 votes
1 answer
91 views

Matricization of a vector

Definitions Define a vector Tuples[a[0, 1], n] of elements $a[i_1,...,i_n], i_j \in \{0,1\} ~\forall j$, that is for instance ...
Baloo's user avatar
  • 167
1 vote
1 answer
65 views

Sorted Tuples without Filtering

Say I have a list $L$ where the elements can be sorted into some canonical order. I want to use Tuples[L,m] but I only want the output lists to be sorted and ...
Ken Robbins's user avatar
4 votes
2 answers
114 views

Tuples which treats re-ordering as equivalent [duplicate]

I would like to define a new function myTuples, that behaves just like Tuples, except that it treats, as with ...
Patrick.B's user avatar
  • 1,509
0 votes
1 answer
117 views

Using Tuples for creating the sample space [closed]

I want to use Tuples (if you know better way please let me know) to create the sample space for some events. Assume that I have 2 events each of which can change to ...
Parviz's user avatar
  • 393
11 votes
3 answers
223 views

Faster searching for subsets with pairwise conditions

I am looking for a faster way of finding large subsets of lists that obey pairwise conditions. In particular, I'm looking for a large (over 10k) set of quaternary words (i.e. ordered lists) of length ...
M.R.'s user avatar
  • 31.5k
5 votes
1 answer
489 views

Generating a list of integers that sums to zero

Given a pair of integers n and k, I want to generate all lists of integers of length n, ...
user366202's user avatar
1 vote
0 answers
61 views

Quickly Generating A List of of Ordered Lists [closed]

I'm looking for a quick way to do this. Define an integer $M$. Function $f[M]$ will output a list of all ordered selections of integers from $1$ to $M$ without repetition. For example: $f[1] = \{\{1\}\...
Ken Robbins's user avatar
1 vote
1 answer
39 views

Joining each element of second tuples to the end of each element of the first tuples [closed]

How can I generate a new tuples by joining each element of tup3 to tup1? For example joining {0,1,1,1,0,-1} from tup1 and {d,0,1} from tup3 to generate {0,1,1,1,0,-1,d,0,1} ...
emnha's user avatar
  • 2,111
3 votes
2 answers
97 views

Generating representatives of rotation classes of tuples of ones and zeros with a fixed number of ones

In a related question I asked how to generate all the tuples of ones and zeroes with a fixed number of ones (generating tuples of ones and zeroes with a fixed number of ones). I wish to consider a ...
EGME's user avatar
  • 647
9 votes
6 answers
645 views

generating tuples of ones and zeroes with a fixed number of ones

I would like to generate all the tuples of ones and zeros of a given length and with a given number of ones without generating all the possible tuples, which is impossible for tuples of large enough ...
EGME's user avatar
  • 647
4 votes
3 answers
553 views

How do I get a list of all possible sums in a list nested list?

Lets say I have the following input: rn={ {1, 1.1, 1.5}, {5, 6, 6.1, 7}, {8, 8, 12, 12, 12.5, 13} } This input has the dimensions of ...
Robjobbob's user avatar
  • 361
9 votes
2 answers
1k views

List of tuples without duplicates & repeated values [duplicate]

Given some number nand set of values vals, I want to obtain all the tuples/permutations of size ...
Phil-ZXX's user avatar
  • 461
3 votes
1 answer
30 views

Referencing data in sets of sets

Given a data set how to assign definitions to the subsets. For instance given the data data = {{0, 1, 1}, {0, 1, 1}, {1, 1, 0}, {0, 1, 1}, {1, 1, 0}} if {0, 1, 1} ...
thinkingdude's user avatar
4 votes
1 answer
133 views

How to list all possible 3-tuples with entries of the 3 tuples from 2 different sets?

If there are two sets $A={1,2,3,4}$ and $B={5,6,7,8}$, how to construct list of all possible 3 tuples where the first two entries are any element from set $A$ and the 3rd entry is any element from set ...
thinkingdude's user avatar
2 votes
2 answers
116 views

Generating a list of tuples that meet certain criteria without running out of memory

I would like to generate tuples of length 21 with possible elements 1, 2, and 3. I would also like there to be an equal number of 1's, 2's, and 3's, and I want to control for how many times one ...
kangaroo's user avatar
1 vote
0 answers
42 views

some questions about tuple

I noticed that Tuples[{0, 1}, 3] gives the eight vertices of a cubic. Tuples[{0, 1}, 2] gives the four vertices of a square. <...
AsukaMinato's user avatar
  • 9,808
3 votes
2 answers
90 views

Making figure from list of tuples

I am generating all possible configurations of NN elements comprising only 0 or 1 as sB[NN_] := Tuples[{0, 1}, NN] Using this, for fixed NN I would like to ...
sdnnds's user avatar
  • 383
2 votes
1 answer
333 views

Tuples with more criteria

I have seen that there is question here which does almost what I wanted to ask but it's not quite what I wanted. Efficiently generating tuples with Outer What I would like to have is a Tuples of a ...
Alessandro Mininno's user avatar
3 votes
2 answers
83 views

Duplicate Tuples in two different ways

Writing: n = 3; Tuples[{"min", "MAX"}, n] I get: {{"min", "min", "min"}, {"min", "min", "MAX"}, {"min", "MAX", "min"}, {"min", "MAX", "MAX"}, {"MAX", "min", "...
πρόσεχε's user avatar
5 votes
4 answers
766 views

What is the identity for Tuples?

My question is, what list p in the following statement returns the list q? Tuples[{{p},{q}}] If we think of Tuples as a binary operator then p would be the ...
JAS's user avatar
  • 71
0 votes
0 answers
80 views

How to list all the possible functions of given structure?

I can run this command : Tuples[{ Tuples[{x, y, z}, 2], {a, b, c}}] to list all combinations that looks like: ...
user152503's user avatar
3 votes
2 answers
207 views

Delete duplicates in tuples

I use the following code to create a list of input parameters: ...
Fabian's user avatar
  • 77
3 votes
4 answers
257 views

Tuples of elements from list excluding anything with repeated values

What I would like to do is the following. For a given list of elements; say (0,1,2,3,4) I would like to obtain all possible combinations of five, but not the ones with ANY repeated values. That is I ...
user avatar
2 votes
1 answer
129 views

Select elements in a list of tuples of quaternions that satisfy a condition

I defined 24 quaternions using the Quaternions package and i create the list of all possible 4-tuples using ListQuad = Tuples[ListQuaternions, 4] where ...
B.manca's user avatar
  • 23
0 votes
1 answer
67 views

how to replace part of tuple

I would like to replace all elements $1/2$ in tuples with $0$, How should i do that I tried already this one : sel1 = ReplacePart[sel[[#]], 1/2 -> 0] The ...
Тахер Бен's user avatar
5 votes
1 answer
317 views

Selecting from a list returned by Tuples

Select[Tuples[{1, 1/2}, {4, 4}], Total [#] == 15] I want to select all tuples in the result returned by Tuples that have total ...
Тахер Бен's user avatar
2 votes
1 answer
87 views

Duplicate Tuples

Writing: Tuples[{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}] I get: ...
πρόσεχε's user avatar