Skip to main content

# Questions tagged [permutations]

Permutations are arrangements of the numbers $1,\ldots,n$ in an arbitrary order.

222 questions
Filter by
Sorted by
Tagged with
0 votes
0 answers
9 views

### Managing hashing overlaps (building a heuristic for the edge of a 3x3x3)

I'm trying to build a 3x3x3 solver for a school project. I got inspired by Ben Botto's solver, which you can find here. Such as Ben does with his solver, I'd like to implement Korf's heuristic ...
0 votes
1 answer
23 views

### Calculating nth permutation with repetition efficiently, with variable number of elements

After a long night of Calculating nth permutation without repetition efficiently, with variable number of elements, I realized I actually want permutations with repetition. Given the ordered set ...
• 141
0 votes
1 answer
13 views

### Calculating nth permutation without repetition efficiently, with variable number of elements

I know I can use the factorial number system to calculate ordered permutations of a set efficiently, given a constant length (for example, ...
• 141
3 votes
2 answers
64 views

• 17
1 vote
0 answers
85 views

### Binary ↔ Gray permutation matrix

Generating a Gray code representation of a binary number can be thought of as mapping one binary number onto another binary number. Therefore, $n$-bit Gray code is a permutation of $2^n$ elements. ...
• 177
1 vote
1 answer
193 views

### number of ways evaluation of expression such that value not changed [closed]

one example: How many ways we can do possible value-preserving parenthesis the following expression in such a way that value not changed after parenthesis with one constraint that parenthesis among ...
• 119
1 vote
1 answer
252 views

### Find Optimal Permutation/Positioning to Minimize the Total Distance for a Given Path

Summary: A task for picking certain objects is given in the form of an ordered sequence (eg. to pick apple, banana, apple, apple, orange, order matters). The objects have to be preassigned to certain ...
• 143
5 votes
6 answers
1k views

### Enumerating all partial permutations of given length in lexicographic order

I need to generate all unique tuples of length k chosen from a series of unique, positive integers. In my case n choose k will have n=10, 1 <= k <= 10; and the series I am choosing from is { 0, ...
• 247
1 vote
1 answer
325 views

### Find The "Best" Permutation of Inputs to Maximize Sum of Functions (or approximate "best")

The Problem (in words) I want to sort $N$ items where the value of item $i$ at position $p$ is given by the function $f_i(p)$. The "best" order for these items is the one that maximizes the ...
• 113
1 vote
1 answer
47 views

### Given permutation $p$, compute $p^{-2}$

I'm now to problem solving, and I need some help and insight on the following problem from HackerRank: Given a sequence $p(1),\ldots,p(n)$ of distinct numbers from $1$ to $n$, find numbers \$y_1,\...