instead of random(1,3) you could use choose(1,2,3)
random(1,3) can also produce 1.5, 1.7, 2.3, etcetera as an answer, so the chance of it being exactly 1 or 2 or 3 is pretty small..
other options would be to use round(random()), floor(random()) ceil(random() or int(random())
from the manual:
random(x)
Generate a random float from 0 to x, not including x. E.g. random(4) can generate 0, 2.5, 3.29293, but not 4. Use floor(random(4)) to generate just the whole numbers 0, 1, 2, 3.
random(a, b)
Generate a random float between a and b, including a but not including b.