# All Questions

86 questions
Filter by
Sorted by
Tagged with
33 views

### Expanding integer compositions

Quick version: I would like Mathematica code that, for instance, turns {3,1,2} into {3,3,3,1,2,2}. More formally, given positive integers $c_1, \ldots, c_t$ which sum to $n$, produce the length $n$ ...
526 views

75 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 ...
59 views

### Groupings of the Elements of a List with at Most $k$ Elements

Given a list with $n$ elements and an integer $k$ I want to get a list with all possible groupings of these n elements in sets with at most k elements. For example, given $n=\{1,2,3,4\}$ and $k=3$ I ...
267 views

### How to calculate all possible resistances made from 5 distinct resistors in series and/or parallel? [closed]

Five distinct resistors resistors={1,2,3,4,5} are given. The objective is to find a list of all possible resistances obtained by configuring all these resistors in ...
408 views

### How to generate all involutive permutations?

Take a finite set $S$ (i.e., a list). An involutive permutation is one that squares to the identity. How can we generate all such permutations efficiently, that is, without generating all permutations ...
45 views

### Generating list of binomial outcomes [closed]

As an example, imagine if I have a set of 3 coins and I want to generate a list of possible coin states. I know I can brutishly execute: ...
238 views