Question 984212: An urn containing n balls can be represented by the set
U = {b1, b2, ... , bn}.
Interpret the following algorithm in the context of urn problems. Does it represent drawing with or without replacement? How many lines does it print?
for
i(sigma symbol) {1, 2, ... , n}
do
for
j(sigma symbol) {1, 2, ... , n}
do
for
k (sigma symbol) {1, 2, ... , n}
do
print
bi, bj, bk
The algorithm prints out all the possible ways to draw_______ balls in sequence, _______________ replacement. **Second blank answer choices are (with) or (without). Please indicate which. It prints __________ lines.
Answer by jim_thompson5910(35256) (Show Source):
You can put this solution on YOUR website! Each iteration has n choices since the set used for each level is {1, 2, ..., n}. That set doesn't change. So the balls are being drawn WITH replacement. There are 3 iterations so 3 balls are drawn. This program lists all of the ways to draw 3 balls from a set of n balls {b1, b2, ..., bn}
There are n*n*n = n^3 ways to draw the 3 balls (from the pool of n balls).
-------------------------------------------------------
Extra Side Note: If NO replacement was done, then the first set would be {1, 2, ... , n} and the second set would be {1, 2, ... , n-1} and the third set would be {1, 2, ... , n-2}. Each time we have 1 less ball to choose from the overall pool.
|
|
|