Hi,
Please let me know is there any standard algorithm to solve the below
mentioned problem.
Problem statement:
I am having 10 apples and 4 basket each basket capacity is as mentioned below:
Basket1 : capacity can hold maximum of 2 apples
Basket2 : capacity can hold maximum of 4 apples
Dave,
You are correct about the first approach. It is biased towards '1' and of
course 000 goes waste.
With the second approach, I couldn't find a uniform distribution, because there
is no power of 5 which is a multiple of 7, as they are relatively prime. For
the errornous approach where 1
@all:
There are k baised coins with probabilty of coming head is
P(i) i = 1 to k. If all these coins are tossed together. find the
probabilty of getting i heads ( i = k).
think in Dynamic Programming.
-Nagendra
--~--~-~--~~~---~--~~
You received
What does optimal balance mean?
In your example case, if you have 10 apples,
put 2 in basket1, 4 in basket2, 4 in basket3 and basket4 gets nothing.
If you have to make sure that, each basket gets at least one apple, then
start distributing apples one by one to each basket until it reaches its
http://stackoverflow.com/questions/137783/given-a-function-which-produces-a-random-integer-in-the-range-1-to-5-write-a-fun
and wat about it
return
(((rand_5()+rand_5()+rand_5()+rand_5()+rand_5()+rand_5()+rand_5())-7)%7 + 1
)
--~--~-~--~~~---~--~~
You
Hello Bharath,
Thanks for your suggestion.
I want to distribute the apple across all the basket balanced way.
In other words
“I want to calculate the optimal number of apples on each basket such
a way that free and used space on each basket equal to total
percentage of free and used space on