------ art_196954_18857784.1174615102822
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
rretzbach's first proposal is exactly the same as mine. I don't think the
probabilities are not evenly
distributed in the proposed. And my program generates the row pattern is the
following:
def make_rows
row1 en_rands_nodup(9, 0, 5, Array.new)
row2 en_rands_nodup(9, 0, 5, Array.new)
row3 0,1,2,3,4,5,6,7,8]-(row1+row2)
row3 en_rands_nodup(9, 0, 5, row3)
end
def gen_rand max,range
rand(max) + range * 10
end
def gen_rands_nodup max,range,num,arr
i rr.length
while i < num do
rand_val en_rand(max,range)
while arr.include?(rand_val) do
rand_val en_rand(max,range)
end
arr[i] and_val
i +
end
arr
end
Is there any bug in this algorithm?
On 2/21/07, rretzbach / googlemail.com <rretzbach / googlemail.com> wrote:
>
>
> This is probably a spoiler, maybe not
> <SPOILER>
> One Idea was to create each ticket, by building 2 rows and complete
> the last row:
> if both elements of the column were nil, mark the third element as
> "to be filled"
> and so on.
>
> But by doing this, I would actually change the probabilities,
> because the last row depends on the first two rows.
>
> So far the only perfect "algo" that came to my mind was to create
> all possible books and chose one randomly.
> By this method the chances are perfectly balanged.
> I mean we're talking about BINGO!
> It's about money... and you should be able to proof that your algo
> generates all possible books at equal probability.
> </SPOILER>
>
> Am I right with that, or is this totally nonsense?
> Either way, please feedback to me :>
>
>
>
------ art_196954_18857784.1174615102822--