/random 1-100(0) until you got the highest 2 times

nzall

New member
Joined
Sep 3, 2011
Messages
6
I'm a gamer, role playing games to be exact. Recently, another Vbulletin forum that i frequent had a discussion on the /roll RNG system used by a number of MMO games to distribute rewards to participating players. Specifically, the discussion handled about /roll 1-100 and 1-1,000 in World of Warcraft and someone made an offhand comment about the occurrence of ties in each system. This made me wonder about some questions:

  1. in a /roll 1-100 system, with each number being equally plausible, what is the chance that out of 5 rolls 2 are tied in first place?
  2. same as above, but for 10 rolls?
  3. same as above, but for 25 rolls?
  4. in a /roll 1-100 system, how many rolls does it take on average before 2 rolls are tied in first place?
  5. - 8. the above questions, but for a /roll 1-1,000 system?
I've done some thinking about this. I've recently read a book by Ian Stewart that handled a similar issue, but that was about how many songs it takes before you hear a song twice in a 1,000 playlist on shuffle.

The thought i've had so far for the first question: The first roll rolls X. The second number has 1% chance to be equal, X-1% chance to be lower and 100-X% chance to be higher. And so on for the other numbers. However, the more i think about it, the more it seems to me that it's just a 1/100% chance, since you just need 2 numbers to be equal. However, this does not seem right to me.

Anyone who can help me shed some light on this issue?
 
I'm a gamer

I'm not



the discussion handled about /roll 1-100 and 1-1,000 in World of Warcraft Huh?



in a /roll 1-100 system

I'm guessing, but I think that most readers on this board would need a definition for this system, before they could consider your questions.

I hope that somebody like Subhotosh, pka, or lookagain is a gamer, such that they can provide you with a cogent response. ;)
 
Basically, the /roll system is as follows:

You open the chat and type "/roll". When you send the message, the server calculates a random number between 1 and 100 and sends that back to you and the players you are currently playing with. You can also add parameters to the request to chance the upper and lower limits. For example, "/roll 1-1,000" gives a random number between 1 and 1,000.

As for the container, yeah, that's basically the idea. Each ball has the same chance to be picked up, and any picked ball is replaced by a ball with the same number.

It doesn't really have to do with the game itself, it's just purely probability. For example, the first question can be translated: A computer generates 5 random numbers between 1 and 100 (or someone draws 5 balls from a container with 100 balls, the balls get replaced. What is the probability that 2 of those numbers are tied and the highest?

E.g. the numbers are 10, 20, 20, 30 and 45. This is not what i mean, because the highest number is 45, but it's only there once. If it's like 11, 34, 35, 67, 67, that's an example of "a tie in first place", because out of 5 rolls, 2 rolled 67, but no other roll was higher.
 
It doesn't really have to do with the game itself

I'm thinking that this is a good thing because the actual "randomness" of random numbers generated by software varies from algorithm to algorithm. In other words, placing confidence in some calculated probability specific to WoW is not as straightfoward as it might seem.
 
OK...now CLEAR :cool:

Ran simulation (10 million times for each); rounded results, per million:

1 - 100: 24,820 (includes 320 where top 3 are equal, 5 where top 4 are equal)

1 - 1000: 2,550 (includes 6 where top 3 are equal)

I don't quite get the gist of this. that 24,820 means what exactly? does that mean it's a 2.482% (24,820/1,000,000) chance of the top 2 being equal?

And the fourth (and eighth) question, about how many times you need to generate a random number between 1 and 100 (or 1 and 1,000) before there's a 50% chance of having the top 2 being equal?
 
Take over, Sir Mark...

I'm not a gamer.

I'm more interested in knowing how many simulations it would take your BASIC program for all five numbers to be identical.
 
Last edited:
To go a bit off-topic for background story: the original discussion on the other Vbulletin forum (MMO-Champion) handled about a specific way of distributing the items (mostly weapons and armor) that are the rewards for completing certain challenges inside the game of World of Warcraft (like killing a certain enemy, or reaching a certain place in a certain time). This distribution is usually handled by a system of randomized numbers as described in my earlier posts. Often times, in a group of, say, 25 players, there might be 5 players who desire a certain piece of armor or weaponry that is rewarded. For example, a staff that increases the power of your spells might be usable by 7 to 10 group members out of all 25 members of the group, while a certain shield might only be desired by 1 or 2 players.

When an item is being distributed, it usually happens as follows: the leader of the group states that players may "roll" for it, after which each member in the group that desires the item orders the game to generate a random number between 1 and 100. These numbers are displayed to the entire group. The player that generates the highest number is awarded the item. In the case of 2 or more players rolling the highest number, the leader asks for a "reroll", in which event the players generate another random number as mentioned above.

The earlier used numbers of 10 or even 25 random numbers being rolled rarely happens. If the entire group would like it (usually some really rare item like a dragon to ride) and everyone has equal benefits from it, the distribution of the item is done by another way. In this case, the group leader generates a numbered list of group members, followed by a random number between 1 and X (X being the amount of group members). The raid member that has the number corresponding to the rolled number is awarded the item.

But to return to the original discussion: depending on what group you are in, the group might choose to make the members generate a number between 1 and 100, or a number between 1 and 1,000, or even both depending on certain criteria which are hard to explain to a non-gaming audience. Someone made an offhand (and seemingly correct) remark that some groups choose to use the wider range because that allows for less chance of there being an aforementioned tie (i.e. 2 players generating the same number with noone generating a higher number).

Now, to return on-topic: the questions 4 and 8, concerning how many rolls it would on average take before you get a tie, also has a more well-known brother, the birthday paradox (http://en.wikipedia.org/wiki/Birthday_problem). However, the problem I state is a more specific version that can be translated to the following: "Given n random integers drawn from a discrete uniform distribution with range [1,d], how high should n be before the probability p(n;d) that the highest number is drawn twice reaches 50%? Solve for d=100 and d=1,000."

I doubt it's the same way to solve this as it would be for the normal birthday problem, or even for the "same birthday as you" problem, because it isn't just 2 times the same number drawn we need, but that number needs to be the highest of all the numbers generated as well.

If there are any more questions that are needed to clarify the , please ask them and I will do my best to answer them.

Just to repeat the generalized question:

"Given n random integers drawn from a discrete uniform distribution with range [1,d], how high should n be before the probability p(n;d) that the highest number is drawn twice reaches 50%? Solve for d=100 and d=1,000."

Note that this is not homework or something. This is just something I've been wondering since I read that offhand remark.
 
Is the introductory problem equivalent to "The number of players = p, where p is an integer > 1. Each player gets 1 roll of a fair die with d sides numbered consecutively from 1 to d, where d is an integer > p. What is the probability on this single round of one roll per player of there being a tie for the HIGHEST number?" In other words, you are interested in the probability that there are one or more ties for the highest number. You are not interested in ties for the lowest number, or for the second lowest number, or even for the next to highest number. You are only interested in who gets the highest number in order to win the really cool dragon or the magic staff or the gorgeous princess who can make you invisible for an hour or two. Am I even starting on the right page?

That's a really good way to explain it, yeah. And question 5 then asks how high p needs to be with d = 100 for the probability to be higher than 50% (so it's more likely than not that there is a tie for the highest number). but I think the above problem will be enough to start with.
 
Top