From: Konstantin on
Hey,
I have a question regarding how to deal with intervals in matlab. There is a determined number of balls "A". Those balls are to be assigned randomly to a determined number of baskets "B". First you draw for each ball "a" a random number "c" between 0 and 1. Then each ball "a" is assigned to a basket "b" in accordance with the bucket in which the respective "c" falls. I.e. in which interval [(b-1)/B, b/B] with b = 1, ..., B the random number c drawn for the ball a falls.
I'd really appreciate if anyone had a good hint!
Thanks very much in advance!
From: TideMan on
On Jul 27, 8:49 am, "Konstantin " <alexander.b...(a)gmail.com> wrote:
> Hey,
> I have a question regarding how to deal with intervals in matlab. There is a determined number of balls "A". Those balls are to be assigned randomly to a determined number of baskets "B". First you draw for each ball "a" a random number "c" between 0 and 1. Then each ball "a" is assigned to a basket "b" in accordance with the bucket in which the respective "c" falls. I.e.. in which interval [(b-1)/B, b/B] with b = 1, ..., B the random number c drawn for the ball a falls.
> I'd really appreciate if anyone had a good hint!
> Thanks very much in advance!

Classic homework question............
Show us the code you have developed so far.
From: Walter Roberson on
Konstantin wrote:

> I have a question regarding how to deal with intervals in matlab. There
> is a determined number of balls "A". Those balls are to be assigned
> randomly to a determined number of baskets "B". First you draw for each
> ball "a" a random number "c" between 0 and 1. Then each ball "a" is
> assigned to a basket "b" in accordance with the bucket in which the
> respective "c" falls. I.e. in which interval [(b-1)/B, b/B] with b = 1,
> ..., B the random number c drawn for the ball a falls.
> I'd really appreciate if anyone had a good hint!

That is equivalent to generating A random numbers each in the range 1 to B.
The documentation on random number generation may perhaps assist you in that task.
From: us on
"Konstantin " <alexander.biel(a)gmail.com> wrote in message <i2ksc0$5g9$1(a)fred.mathworks.com>...
> Hey,
> I have a question regarding how to deal with intervals in matlab. There is a determined number of balls "A". Those balls are to be assigned randomly to a determined number of baskets "B". First you draw for each ball "a" a random number "c" between 0 and 1. Then each ball "a" is assigned to a basket "b" in accordance with the bucket in which the respective "c" falls. I.e. in which interval [(b-1)/B, b/B] with b = 1, ..., B the random number c drawn for the ball a falls.
> I'd really appreciate if anyone had a good hint!
> Thanks very much in advance!

what have YOU done so far to solve YOUR particular problem...

us