Questions tagged [balls-and-bins]

7 questions
13
votes
1 answer

Filling bins with pairs of balls

A bin is called full if it contains at least $k$ balls. Our goal is to make as many bins as possible full. In the simplest scenario, we are given $n$ balls and may arrange them arbitrarily. In that case, obviously the best we can do is pick…
Erel Segal-Halevi
  • 6,088
  • 1
  • 25
  • 60
13
votes
1 answer

Use minimum number of swaps so each bin contains balls of the same color

There are $n$ bins, the $i$th bin contain $a_i$ balls. The balls has $n$ colors, there are $a_i$ balls of color $i$. Let $m=\sum_{i=1}^n a_i$. A swap is take a ball from one bin and swap with a ball from another bin. We want minimum number of swaps…
Chao Xu
  • 3,103
  • 19
  • 34
2
votes
1 answer

Finding a specific "balls-into-bins" partition given its index in the lexicographical ordering

Given numbers $n,k\in \mathbb{N}$, we consider $\mathcal P$ to be the set of all possible partitions of $n$ balls into $k$ bins. Alternatively, $\mathcal P$ is the set of all $k$-ary vectors in $\{0,1,\ldots,n\}^k$ such that the sum of the entries…
R B
  • 2,644
  • 17
  • 35
2
votes
1 answer

Load balancing. Why not use priority queues?

I have recently learned about various randomized algorithms for load balancing. The model is always that there are $m$ balls and $n$ bins and the balls arrive one at a time. The task is to minimize the maximum load of any bin. However there is…
1
vote
1 answer

Distribution maximizing ratio of expected maximum over the mean

I’m looking for a distribution that is non-negative, or has good tail bounds (so non-negative with high probability) and maximizes the ratio between the expected maximum of $n$ iid samples and the mean. That is, if $X_1,\ldots,X_n$ are iid samples…
1
vote
0 answers

Algorithms of placing N weighted balls into M uniform bins while striving for balanced weight?

Suppose there're $N$ weighted balls and $M$ equal weight bins, it's guaranteed at least one placement exists that all the balls can be placed into bins. What's the right algorithm to achieve a well-balanced placement where each bin has almost equal…
i3wangyi
  • 33
  • 4
1
vote
1 answer

Assigning $m$ balls to $n$ buckets - recursive algorithm

I came across the following problem and the answer to that problem: Given $m$ balls and $n$ bins, find out how many ways to assign the balls to the bins. Notice the bins have no order: for example, $(1,2,3)$ and $(3,2,1)$ are considered the…
user299582
  • 11
  • 1