combinatorics
Prolog: how to do "check(a++b++c++d equals d++a++c++b) -> yes"
Let\'s define custom operators - let it be ++,equals :- op(900, yfx, equals). :- op(800, xfy, ++). And fact:[详细]
2023-04-01 01:12 分类:问答Randomly Generate a set of numbers of n length totaling x
I\'m working on a project for fun and I need an algorithm to do as follows: Generate a list of numbers of Length n which add up to x[详细]
2023-03-28 07:33 分类:问答Population segmentation algorithm
I have a population of 50 ordered integers (1,2,3,..,50) and I look for a generic way to slice it \"n\" ways (\"n\" is the number of cutoff points ranging from 1 to 25) that maintains the order of the[详细]
2023-03-26 00:48 分类:问答Maximize sum of table where each number must come from unique row and column
Suppose we have a table of numbers like this (we can assume it is a square table): 202134 511489 1512171711[详细]
2023-03-25 15:57 分类:问答How to get all possible string permutations with PHP?
There is a mapping of characters, like so: $replacements = array( array(\'a\', \'b\'), // a => b array(\'a\', \'c\'), // a => c[详细]
2023-03-25 10:54 分类:问答R: Generating all permutations of N weights in multiples of P
I need to create a function (in R) which: - given N possible variables to attribute weights to; - creates all possible permuati开发者_Python百科ons of weights (summing to 100%);[详细]
2023-03-24 07:41 分类:问答PHP: Permutations of 26 letters in X characters
I have an alphabet array with 26 characters A..Z . I am searching for a performant algorithm that list开发者_运维技巧s all permutations that fill an array of length X without any repeating characters[详细]
2023-03-23 12:23 分类:问答Python - Iteration over nested lists
I\'m stuck on a small but tricky problem since yesterday. What I have is a (possibly infinitely) nested list like this:[详细]
2023-03-23 10:56 分类:问答How to find permutation of a given string with its rank?
For example, rankpermutation 0abc 1acb 2bac 3bca 4cab 5cba So, if one asks give me permutation with rank 4, the answer is cab.Pls give the java code for this progra开发者_开发百科mI made it at a fi[详细]
2023-03-22 05:00 分类:问答Efficient item binning algorithm (itertools/numpy)
I think this is a common combinatorics problem, but I can\'t seem to find a name for it开发者_开发技巧 or any material about it. I am doing this in Python and numpy, but if there is a fast matrix meth[详细]
2023-03-21 04:18 分类:问答