Linked Questions

8
votes
4answers
884 views

Tuples with one “joker” digit? [duplicate]

I'd like to create an array of all possible length 11 combinations of 1, 2, and the number 3, BUT with the number 3 only appearing zero or once in each combination. I tried: ...
34
votes
6answers
3k views

Partition a set into subsets of size $k$

Given a set $\{a_1,a_2,\dots,a_{lk}\}$ and a positive integer $l$, how can I find all the partitions which includes subsets of size $l$ in Mathematica? For instance, given ...
20
votes
6answers
635 views

How to generate all possible orderless partitions of a list according to another list?

This question is hard to describe in plain text. So I will post an example and a working code (brute force) to illustrate. For example I have a list: ...
20
votes
6answers
1k views

On generalizing Partition[] (with offsets) to sublists of unequal length

The usual Partition[] function is a very handy little thing: ...
19
votes
4answers
2k views

Finding all dictionary words that can be made with a given set of characters (Wordfeud/Scrabble)

This is a slightly more involved variant of this recent question. By sheer coincidence I happened to have been building a Wordfeud (Scrabble clone) game in Mathematica. My interactive Wordfeud board ...
10
votes
4answers
375 views

Efficient way to make subsets of list with placeholders

I have an arbitrary list of unique elements: lst = {a, b, c, d} Documentation allows finding subsets with same number of elements, say ...
7
votes
3answers
322 views

Center of mass in the plane

I have three masses of 3, 4, and 5, located at the points $(-1,1)$, $(2,-1)$, and $(3,2)$. To find the center of mass, I performed these steps. ...
5
votes
2answers
179 views

Combinatorics: Placed errors

Consider a vector of length n where each element can take one of the values U, X, ...
3
votes
2answers
200 views

Apply UpValues before Listability

I'm trying to modify Plus but am running into trouble with it being Listable: ...
0
votes
0answers
71 views

Generate all strings of fixed length from an alphabet [duplicate]

I am trying to create all possible strings of length $8$ from the alphabet $\{+1,-1\}$. I am trying to get help from this question. But not sure where to start from. Any help?