do not exactly agree on what you mean by "randomly generate a number between 1 and 50". Toolic puts 50 balls in a hat and chooses five of them. Discipulus keeps putting each ball back in the hat before he draws again. One difference is that the first method has no possibility of drawing the same number twice.