Top "Combinations" questions

A combination is a selection of objects from a larger collection in no particular order.

How to generate all pairs from two vectors in MATLAB using vectorised code?

More than once now I have needed to generate all possible pairs of two vectors in MATLAB which I do …

matlab combinations
Calculate value of n choose k

What is the most efficient method to evaluate the value of n choose k ? The brute force way I think …

algorithm language-agnostic combinations
How can a KeyListener detect key combinations (e.g., ALT + 1 + 1)

How can I let my custom KeyListener listen for combinations of ALT (or CTRL for that matter) + more than one …

java swing combinations keylistener keyevent
How to efficiently calculate a row in pascal's triangle?

I'm interested in finding the nth row of pascal triangle (not a specific element but the whole row itself). What …

algorithm combinations binomial-coefficients pascals-triangle
Get unique combinations of elements from a python list

Edit: This is not a exact duplicate of How to get all possible combinations of a list’s elements? This …

python list combinations
Generate all binary strings of length n with k bits set

What's the best algorithm to find all binary strings of length n that contain k bits set? For example, if …

algorithm binary permutation combinations bits
Javascript - Generating all combinations of elements in a single array (in pairs)

I've seen several similar questions about how to generate all possible combinations of elements in an array. But I'm having …

javascript arrays algorithm combinations
counting combinations and permutations efficiently

I have some code to count permutations and combinations, and I'm trying to make it work better for large numbers. …

python algorithm math combinations permutation
PHP algorithm to generate all combinations of a specific size from a single set

I am trying to deduce an algorithm which generates all possible combinations of a specific size something like a function …

php algorithm statistics combinations
How to generate in PHP all combinations of items in multiple arrays

I'im trying to find all combinations of items in several arrays. The number of arrays is random (this can be 2, 3, 4, 5...). …

php arrays combinations iteration