andrefabud: the trick is in the following event since there's a test to see if the number is superior to 50, than you drop loot.
Meaning you have 50 chances out of 100 to have a drop => 50% chances.
Your reasoning is (almost) valid too.
With the random expression, the last number you give in the range will never be returned. So in your "random(1,2)" you could have results returned like 0.5 or 1.999999 or 0.122355565, etc...
That's where the int() cast is useful.
And considering you would use int(random(1,2)) then the only result would be 1.
With int(random(1,3)) you would either get 1 or 2, and then could, in the next event just test if the result is indeed 2 and then drop loot.