Combinatorics is the branch of computer science and math that focuses on the enumerable arrangements of a finite set. This includes permutations, combinations, and partitions.
0
votes
1answer
48 views
The maximum number of induced cycle in a simple directed graph
Given a simple directed graph G=(V,E) an induced cycle is a cycle where no two vertices of the cycle have an edge that is not in the cycle.
(Chordless cycles are induced cycles with at lease 4 ...
1
vote
2answers
128 views
Algorithm to create all unique sets of the alphabet using arbitrary group sizes
I'm looking for an algorithm to help me out with a combination of combinations problem.
I have generated two lists of combinations of letters: (26 choose 6) & (26 choose 5)
My goal is to be able ...
0
votes
1answer
55 views
Mapping match-up combinations into an integer
First of all, I want to say I wasn't sure if I should post this here or in math.stackexchange but I think the question is too programming-related to belong to the latter community. Definetly not a SO ...
2
votes
0answers
52 views
Restricted randomization of a binary vector
Suppose I have a binary vector of sample size N with each of the two possible values (e.g., 0 and 1 occurring equally often).
For example, if N=10, the binary vector is: 0 0 0 0 0 1 1 1 1 1
Suppose ...
0
votes
0answers
43 views
What algorithm to use to count realization of high combinatorics setup?
I'll use the MobA games to illustrate what I'm asking since it's easier to explain even tho I want to apply that algorithm to time series.
In a MobA game you have more than 100 characters and every ...
0
votes
0answers
46 views
Approaches to combinatorial optimization problem
Problem
I have the following combinatorial optimization problem:
A set of applications need to be distributed among a set of nodes.
Each node has a capacity and each application has a required ...
12
votes
1answer
355 views
Fast indexing of k-combinations
I'm revisiting an old problem that I was working on some time ago.
A typical scenario is "3 bits are set within an 8 bit integer", i.e. 00000111.
All unique combinations with 3 set bits can easily ...
3
votes
1answer
270 views
Algorithm to compute k-permutation without repeating and no duplicates
I have a set of integers, for example 1..20 and I want to get all possible combinations of that set drawing 5 numbers.
So each combination has 5 numbers from that set of integers. But I don't want ...
1
vote
2answers
140 views
Given an array of n bits, how to generate every permutation with i 1's and n-i 0's?
It's simple enough to brute force a collection of strings and then filter for every occurrence with the required count of 1's.
As n increases the number of possible permutations becomes very large, ...
0
votes
0answers
74 views
Domain analysis for discrete values - ON and OFF points in these cases
Following my previous question (with great answer from Bart van Ingen Schenau), I noticed a discrepancy I could not wrap my head around:
Bart mentioned that:
The point ON the boundary is by
...
1
vote
3answers
393 views
Domain analysis - why OFF points are inside of the domain when the border is open
I have asked on a few other sites, no response but it must be something silly as many authors mention in their books.
Here is the best text I found:
My ultimate question is:
Why the OFF point lies ...
4
votes
2answers
897 views
Number of strings containing a specific substring
I've seen numerous questions (and answers) concerning the number of binary strings (e.g "10010" containing some binary substring (e.g "00"). I'd like to know if there is a way to generalize this:
...
0
votes
1answer
366 views
Number of sequences when no adjacent items can be the same
I came across this one problem,
There is a particular sequence only uses the numbers 1, 2, 3, 4 and no two adjacent numbers are the same.
Write a program that given n1 1s, n2 2s, n3 3s, n4 4s ...
0
votes
1answer
557 views
How do I create every permutation [closed]
I have a list of letters, this is just an example list:
['a','b','c','d','e']
How do I compute every combination of the list? The letters cannot repeat, for example.
a,b,c,d,e
a,c,b,d,e
a,c,d,b,e
...