Finding percentages by three weights I have three groups with weights like
Group A - 10
Group B - 5
Group C - 3

And I have a grand total of $100$ elements to assign to these groups based on their weights. I need to find the percentages of each element like:
Group A gets $75%$, Group B gets $15%$ and group C gets $10%$
because I need to know how many elements of that $100$ total to assign to each group. How can I do this?
 A: I'm assuming that you want to assign elements to the groups in proportion to the groups' weights. The weights total $10+5+3=18$, so Group A has $\frac{10}{18}=\frac59$ of the total weight and should therefore get $\frac59$ of the elements; rounded to the nearest element, that's $56$ elements. Group B has $\frac5{18}$ of the total weight and should get $\frac5{18}$ of the elements; rounded to the nearest whole element, that's $28$ elements. Group C has $\frac3{18}=\frac16$ of the total weight and should therefore get $\frac16$ of the elements; rounded to the nearest element, that's actually $17$ elements. Unfortunately, $56+28+17=101$; in this example you'll disturb the proportions least by reducing Group A's allotment to $55$ elements.
A: A gets $\dfrac{10}{10+5+3}$ of the total ($100$).
B gets $\dfrac{5}{10+5+3}$ of the total, and C gets $\dfrac{3}{10+5+3}$ of it.
In this case, the exact numbers (with the total being $100$) work out to $55.555\dots$, $27.777\dots$, and $16.6666\dots$.
As these are not integers, you may want to tweak them a little (while keeping the sum $100$), say $55$, $28$ and $17$. 
Or, if you care more about the proportions being exactly right than about the sum being exactly $100$, you can pick the closest number to the total $100$ that is a multiple of the deniminator of the fractions in reduced form — in this case, the closest multiple of $18$ to $100$ are $90 = 18 \times 5$ or $108 = 18 \times 6$ — then assign them exactly: either $(50, 25, 15)$ (adding up to $90$) or $(60, 30, 18)$ (adding up to $108$).
A: Well, here's my crack at it.
You have a 100 elements to distribute.
Weights are in the ratio $A:B:C = 10:5:3$.
That is, $$A = \frac{10}{10+5+3} = \frac{10}{18} = \frac{5}{9}$$
$$B = \frac{5}{10+5+3} = \frac{5}{18}$$
$$C = \frac{3}{10+5+3} = \frac{3}{18} = \frac{1}{6}$$
So (technically) $A$ gets $100 \times \frac{5}{9} = 55.56$ elements, $B$ gets $100 \times \frac{5}{18} = 27.78$ elements and $C$ gets $100 \times \frac{1}{6} = 16.67$ elements.
Of course, as Brian said (faster) you should round all of these off to the nearest integer, and reduce A's allotment by one to stay as close to the original distribution as you can.
