Top "Permutation" questions

A permutation is an arrangement of objects into a particular order.

How to find all permutations (with repetition) in MATLAB?

Suppose I have 4 letters and I want to arrange them in 3 places (repetition allowed), so I would have 43=64 possible permutations. …

matlab permutation cartesian-product
Please explain this algorithm to get all permutations of a String

The following code generates all the permutations for a string: def permutations(word): if len(word)<=1: return [word] #get …

python string recursion permutation
Solving Puzzle in Python

I got one puzzle and I want to solve it using Python. Puzzle: A merchant has a 40 kg weight which …

python permutation combinations puzzle itertools
Given n and k, return the kth permutation sequence

The set [1,2,3,…,n] contains a total of n! unique permutations. By listing and labeling all of the permutations in order, …

java algorithm data-structures permutation backtracking
Generating Permutations using LINQ

I have a set of products that must be scheduled. There are P products each indexed from 1 to P. Each …

c# linq permutation
How to tell if an array is a permutation in O(n)?

Input: A read-only array of N elements containing integer values from 1 to N (some integer values can appear more than …

arrays algorithm permutation
Number of n-element permutations with exactly k inversions

I am trying to efficiently solve SPOJ Problem 64: Permutations. Let A = [a1,a2,...,an] be a permutation of integers 1,2,...,n. …

algorithm permutation dynamic-programming combinatorics discrete-mathematics
Why does Python's itertools.permutations contain duplicates? (When the original list has duplicates)

It is universally agreed that a list of n distinct symbols has n! permutations. However, when the symbols are not …

python algorithm language-design permutation
How to permutate tranposition in tensorflow?

From the docs: Transposes a. Permutes the dimensions according to perm. The returned tensor's dimension i will correspond to the …

python numpy tensorflow permutation transpose
Torch: How to shuffle a tensor by it's rows?

I am currently working in torch to implement a random shuffle (on the rows, the first dimension in this case) …

lua permutation lua-table torch tensor