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 ...
1
vote
1
answer
172
views
Number of binary numbers given constraints on consecutive elements
I've been trying to solve this question for quite a while, given to us by our discrete maths professor. I've been having a hard time in general with it, so I thought I tried looking it up online but ...
1
vote
1
answer
395
views
Choose unique numbers from different sets
Suppose that there are n, possibly equal, non-empty sets. The problem is concerning choosing unique n numbers such that first ...
2
votes
0
answers
82
views
Revealed preference rank rule: variation on horse race problem
Suppose there are x number of objects to be ranked. Then there are x[(x-1)/2] possible comparisons of these objects. Only subsets of x can be evaluated for comparisons and there is always one most and ...
0
votes
0
answers
87
views
Minimum movements to arrange fruits in boxes
I have $3$ boxes - $B_1, B_2, B_3$. Each box initially contains a mixture of $3$ different kind of fruits say - Apple, Orange, Mango. Our goal is to arrange the fruits in the boxes in such a manner ...
0
votes
1
answer
1k
views
Finding number of subarrays not including certain pairs
How many contiguous subarrays of an array exist such that they do not contain certain pairs of positions of the array?
For eg. if array ={11,22,33,45}
and if we do not want to include say position ...
1
vote
0
answers
46
views
Number of ways to connect sets of k vertices in a perfect n-gon [duplicate]
This is a copy of my post at Mathexchange.com, as my question is still not fully answered and I really wanna find a solution to this. Feel free to refer to there for useful comments and partial ...
0
votes
1
answer
267
views
Permutation and Combination - Algorithm
Given Data in the problem
For I= 1 to 10
print(x)
means executing the immediate next line after for loop command 10 times. So here it prints "x" 10 times. Typical simple for loop construct in ...
0
votes
1
answer
4k
views
What is the meaning of ${}^n C_k \times {}^n P_k$?
I am trying to understand the bulls and cows document, Page $6$, equivalences.
Can someone please tell me what author means when he says
$\boldsymbol{ {}^n C_k \times {}^n P_k}$ like ${}^4 P_0 \...
3
votes
2
answers
3k
views
Sum of multiplication of all combination of m element from an array of n elements
Suppose I have an array {1, 2, 3, 4} and m = 3.
I need to find:
...
1
vote
1
answer
260
views
Catalan numbers with both prefix and suffix
In one of the applications of Catalan number,it calculates the number of Dyck word in which a string consisting of n $X's$ and n $Y's$ such that no prefix of the string has more $Y's$ than $X's$, and ...
1
vote
0
answers
822
views
Permutation for arranging letters in such a way that no similar letters come together (except SPACE)
I would like to get a general expression for arranging n letters such that any similar letters in them never come together (except SPACE).
For example :
Lets take AABBCCC and three spaces(...
3
votes
2
answers
246
views
Maximum number of seating plans
15 people will be seat in a row of 15 chairs.
Two seating plan are considered the same if
two plans share same adjacent quadruples.
What is the maximum number of seating plans can be made?
For ...
2
votes
1
answer
293
views
Counting permutations, with additional restrictions
There are 10 slots and some marbles: 5 red, 3 blue, 2 green, how many ways can you fit those marbles into those slots?
Those marbles fit in 10!/(5! 3! 2!) ways
...