Top "Combinatorics" questions

Deals with combinations of entities belonging to a finite set in accordance with certain constraints.

How to generate all permutations of a list?

How do you generate all the permutations of a list in Python, independently of the type of elements in that …

python algorithm permutation combinatorics python-2.5
Permutations between two lists

I’m having trouble wrapping my head around a algorithm I’m try to implement. I have two lists and …

python list algorithm itertools combinatorics
Creating all possible k combinations of n items in C++

There are n people numbered from 1 to n. I have to write a code which produces and print all different …

c++ algorithm math combinations combinatorics
How can I print out all possible letter combinations a given phone number can represent?

I just tried for my first programming interview and one of the questions was to write a program that given …

algorithm language-agnostic combinatorics
Combinatoric 'N choose R' in java math?

Is there a built in method in a java library that can compute 'N choose R' for any N, R?

java math combinatorics
Number of combinations (N choose R) in C++

Here I try to write a program in C++ to find NCR. But I've got a problem in the result. …

c++ combinatorics binomial-coefficients
Algorithm to get all the combinations of size n from an array (Java)?

Right now I'm trying to write a function that takes an array and an integer n, and gives a list …

java combinations combinatorics
Generating permutations with repetitions

I know about itertools, but it seems it can only generate permutations without repetitions. For example, I'd like to generate …

python permutation combinatorics
Permutations - all possible sets of numbers

I have numbers, from 0 to 8. I would like in result, all possible sets of those numbers, each set should use …

php permutation combinatorics
The pythonic way to generate pairs

I want something like code below, but "pythonic" style or using standard library: def combinations(a,b): for i in …

python generator combinatorics