Hello everyone!

I've been working with simulations lately, we've had to run these simulations for how certain groups do relative to each other. I've thought of using python to build a better, more automated model. While conceptually I know what I want to do, in theory I've had some trouble.

Basically, every group is assigned a variable. In this group of 10, each group receives a value. The most highly ranked group is 10, the lowest is 1.

a = 10

b = 9

c = 8

d = 7

e = 6

f = 5

g = 4

h = 3

i = 2

j = 1

If two groups are compared to each other, there is a higher probability of the more highly ranked group 'winning'. So a has the best chance of winning while j has the lowest. However, b has a higher chance of beating athan the others. It is also possible for groups to draw. The closer they are to each other, the higher the chance of drawing.

So each group is a variable with the rank stored in it. Then the idea is to get a random number that if added to the lower ranked group will yield a result. So let's say the number is 2

If the simulation compares a to b, then b would win as the end result of b would be b + 2 (11). If the random number is 1 then there is a draw, and if the number is 0, then a wins. But this is where I see two problems.

First of all, I want closely ranked groups to have a more limited set of numbers. so in an a and b simulation, maybe only 0, 1 and 2 would be available, while in the a and c simulation, 0, 1, 2, and 3 would be available. The reason behind this is because if the range is too high for closely ranked groups, the lower group has a higher chance of winning.

The second problem, and, actually, the primary problem is how to generate the limited range of random numbers.

Any hints, tips and suggestions would be great!

Thanks!