Search results

  1. R

    I Partitioning a whole number in a particular way

    Another example is: w1 = 11 w2 = 39 w3 = 3 W = 53 P = 25 ROUND(P*w1/W) = 5 ROUND(P*w2/W) = 18 ROUND(P*w3/W) = 1 This sums to 24 but we have 25 pieces.
  2. R

    I Partitioning a whole number in a particular way

    I'm not sure what round off means. If round off means raise anything with a decimal >= .5 the next whole number and anything with a decimal <.5 to the next whole number down, then the example will still lead to 18 pieces being assigned.
  3. R

    I Partitioning a whole number in a particular way

    Thanks for the replies. I don't mind so much favoring someone more than others as long as: (ai<=wi) is not violated we assign exactly P pieces of pizza. no more, no less only whole slices can be assigned (no fractions for ai) For example, if we have w1 = 25 w2 = 9 W = 34 P = 17 Then...
  4. R

    I Partitioning a whole number in a particular way

    Hi, Let W be the sum of all the people's weights, let P be the total number of pizza slices available. If: I have P slices of pizza (P<=W) I have n people I want to split the pizza with I want to use people's weight to determine how many slices they get (more weight -> more slices) I don't...
Top