All Questions
43
questions
0
votes
0
answers
163
views
1v1v1 Round Robin Schedule; How many possibilities? How to generate?
I am trying to create a round-robin bracket generator for a game where each match contains three teams competing against each other (1v1v1) given the teams, rounds, and rooms in Python. I don't ...
-1
votes
1
answer
59
views
Is there an efficient way to loop through this problem? [closed]
So I saw this very interesting problem. Let's say you have a length of 2, and a base length of 5
l = 2, b = 5
this would be translated to :
...
0
votes
4
answers
195
views
Get all the methods to break 100% into certain number of parts?
Being straight about the question, for a program I'm writing, I need to divide 100% into 5 parts. In my program, percentages incremented/decremented by 10%. So I can express my requirement in the ...
1
vote
0
answers
30
views
Can we find a proper $\phi$ so that maps each interval to its center?
For a compact interval $[0,1]$, we divide it into $N^{1/3}$ subintervals with length $N^{-1/3}$. Define a map $\phi: [0,1]\mapsto [0,1]$ maps each subintervals to its center.
For example, let $X\sim ...
1
vote
0
answers
42
views
Algorithm to compute monomial coefficients from Vieta's Formulas
Let's say I know the $N$ roots $\boldsymbol r$ of a polynomial $p_N(x)$ and I want to compute the coefficients $\boldsymbol \alpha $ of the representation in monomials, i.e.,
$$p_N(x) = \sum_{j=0}^N \...
0
votes
2
answers
576
views
Algorithm to derive possible combinations of a set e.g., $A = [1, 2, 3, 4]$ and $k = 3$ and $L = [[1, 2, 3], [1, 2, 4], [1, 3, 4], [2, 3, 4]]$
Given a set of numbers A and an integer k, I want to derive a list of sets L such that all the sets in L are the distinct combinations of the elements in A picking k at a time.
For example: $A = \{1, ...
0
votes
1
answer
53
views
Optimal Card Game Schedule
I have the responsibility of creating a schedule for a card game league. While creating the schedule, the following problem has arisen...
Let $n,g,s \in \mathbb{N+}$ where $s \leq n$.
Let $P = \{1, 2, ...
1
vote
2
answers
71
views
Looking for an algorithm
I have a very long "list" of numbers ( maybe thousands ) which may be grouped, by sum into "n" groups. The number of groups and values are given. For example:
List of numbers: [1, ...
1
vote
0
answers
55
views
How do I find unique rearrangements when given items & the item distributions?
I'm not sure what this type of question is called, but this what I'm trying to solve:
I own
3 hats
1 hat is red
2 hats are blue
4 shirts
1 shirt is red
1 shirt is blue
2 shirts are green
5 pairs ...
1
vote
0
answers
34
views
How many variatons of winners are there in 15 1vs1 matchs
I am trying to find a program or some way to show me every variation of winners from just 5 matchs of 1vs1.
I think there should be 900 variation i just need a way to see it all written down ..
For ...
6
votes
1
answer
317
views
Math behind this SQL problem
I have the following 'sorted by row' lists (2nd column), in which every row produces an output (3rd column, and 4th column). This output has been found without using formulas and it represents a ...
4
votes
0
answers
159
views
Finding simple algorithm to combine students into different groups
I'd like to find an algorithm as simple as possible to solve the problem below.
The same seven students will each day be divided and meet into two groups, one with four students and one with three. ...
0
votes
0
answers
139
views
Arranging 3 types of balls with given conditions.
There are 3 types of balls black, white and green. Find the number of ways of arranging $n$ such balls such that
black, white adjacent pairs occur $a$ times,
black, green adjacent pairs occur $b$ ...
0
votes
1
answer
106
views
Efficiently modify the combined probability of many independent events when variable values change
Question:
Let $C_1$ and $C_2$ be two events that are independent and not mutually exclusive that occur with different probabilities $p_1$ and $p_2$.
For these two events, I understand that:
$$ P(C_1 \...
6
votes
4
answers
3k
views
What's the number of decibinary numbers that evaluate to given decimal number?
Let's define a decibinary number system, where each bit (or digit) can range from $0$ to $9$, but it's place value corresponds to the one in the binary system. For example:
$$(2020)_{decibinary} = 2 \...
2
votes
1
answer
448
views
Number of Combinations of Items from Sets with Dependencies
Given a collection of $n$ sets of elements, and choosing exactly 1 element from each set, where $S$ is the size (number of elements) of a set, then the total number $w$ of possible combinations of ...
1
vote
1
answer
101
views
Efficient way to count the number of ways to select 3 numbers from a given list has their AND(bit-wise) equal 0
Suppose a list A contains non-negative numbers no larger than $2^8$.
Eg. A = {4, 9, 6, 1, 15, 8, 3, 5, 18, 7}
I want to find the number of selecting 3 members of A such that their AND bit-wise ...
0
votes
3
answers
4k
views
All possible ways to split a number
I am trying to find a way to find (if it is possible) how many ways there are to split a number of n digits considering that the "splits" can occur everywhere and the subsets don't have to be the same ...
0
votes
1
answer
191
views
Algorithm to find integer combinations satisfying a set of inequalities
I have an engineering problem that is reduced to finding a set of positive integer combinations satisfying several inequalities and some other properties.
Specially, let $\mathcal{S}$ be the set of ...
0
votes
1
answer
57
views
How to create subsequences from a set of ordered integers given the specified constraints.
Given, for example, the following set of integers $\{1,2,3,4\}$, how can you compute the number of all possible sequence scenarios, where a scenario consists of a number of sequences, as following ...
0
votes
2
answers
681
views
How many ways of arranging 6 a's and 10 b's with no consecutive a's?
I think we can assume every b is a box and every a is a ball, and it looks like there are 10 boxes and 6 balls. So I think there are C(15 5) (15 choose 5) ways for the combination. But the correct ...
1
vote
0
answers
152
views
Number of substrings - Combinatorics
Say you have two strings $A = a$ and $B = b$. Now, how do I come up with an expression that gives me the number of substrings of $C = abaa$ that contain atleast one occurrence of both $A$ and $B$?
...
1
vote
2
answers
299
views
Unique combinations of datapoints into two bins? [closed]
I have a set of data of size $X$, say $X = 7$. I want to find all of the unique ways that the data can be grouped into two bins of a minimum size of two. For the example where $X = 7$, I have:
...
1
vote
1
answer
354
views
Random knapsack algorithm: Select n positive integers that sum up to S
Problem to solve:
Have a list of M products (eg 100000) with various prices.
I want to randomly select n products(eg 10) that their sum of prices is S(eg. 100).
Duplicates are allowed or not, does ...
1
vote
2
answers
60
views
Algorithm to pick sets to equal a given input of colored balls of different amounts
I have a specific problem and I am kind of stuck. Don't know exactly where to begin defining what it is. Is someone could just give me a nodge in the right direction or even better, tell me what kind ...
2
votes
2
answers
79
views
How to determine if two numbers can be used to arithmetically find any arbitrary number?
Say you had a scale, with two weights of two different values used to balance it. Is there any way to determine if two given weights could be used to weigh any arbitrary object? For example, say the ...
1
vote
2
answers
639
views
Number of combinations of increasing tuples given their sum
A tuple is represented by
$(a_i,a_{i-1},...,a_1)$ where $a_i<a_{i-1}$ and $i \in \{2...N\}$
So, valid tuples are $(1,2,3,4)$ and $(2,5,9,41)$
You are given the sum of these tuples
$a_i + a_{i-1}...
1
vote
1
answer
308
views
2 variables "variable weighting" function
I have two variables $X,Y \in [0,1]$ and want to output some kind of weighted indicator based on these two. X is a raw indicator value where a low value indicates good health, and Y measures ...
0
votes
1
answer
54
views
Minimum number of steps required to visit every "special" point on a rectangular gird
I am stucked at this problem:
Suppose we have the following grid configuration (or matrix) $G\in \Bbb{M}^{\{0,x,y\}}_{m\times n}$
(I.e $G$ is a matrix that have $m$ rows and $n$ colums over the ...
4
votes
3
answers
511
views
Minimum number of steps required to visit every corner of a rectangular grid
I am stucked at this problem:
Suppose we have the following grid configuration (or matrix) $G\in \Bbb{M}^{\{0,x,y\}}_{m\times n}$
(I.e $G$ is a matrix that have $m$ rows and $n$ colums over the ...