Random Number Generator
RNG is a popular acronym for a Random Number Generator. In the Kingdom of Loathing, as in most computer-based games, a random number generator is used for deciding everything from which Adventure you receive while adventuring to how many stats you receive from certain food or drink items.
In the official forums and chat, it has become popular to refer to it as "evil" due to the luck factor involved. It is common to see people complaining that the "RNG hates me" when a particular item they are looking for "refuses to drop." Many speed ascenders have their records ruined when a required Quest Item refuses to drop.
Among some, it is half-jokingly said that complaining to the RNG is a type of ritual that actually makes a drop more likely.
Common places where people complain about the KoL RNG include the Hippy Camp, the Penultimate Fantasy Airship, The Castle in the Clouds in the Sky (during the Giant Trash Quest), the Deep Fat Friars' Gate, The Cyrpt (during the Undefile the Cyrpt Quest), The Valley Beyond The Orc Chasm, The Misspelled Cemetary (during The Wizard of Ego quest) and Itznotyerzitz Mine.
It used to be common to see people complaining about spending hundreds (literally) of adventures attempting to find an eyepatch, but the addition of the multiple choice adventures fixed that problem.
The Random Number Generator is currently embodied, within the game, as the NPC player The RNG.
Technical Details
It is believed that many random numbers in the game follow a uniform distribution. This means that if a sword does 20-40 damage, each of the 21 values 20,21,22,...,39,40 are equally likely. This is mostly achieved through the use of a random number generator known as the Mersenne Twister. There are certain places in the game, however, where the random number generator is different or adjusted. Most notably, the placement of the monsters in the Sorceress' Tower is not uniformly distributed.
In many cases the game uses an unusual rounding mechanism: if a player were to earn 21.75 XP for a given encounter, the game with probability 0.75 will give 22 XP, with probability 0.25 will give 21 XP. Over the long term of several such encounters, this will average out to the 21.75 base value.
In cases where the number is simply coerced to an integer the floor function seems to be most commonly used, far more than ceiling or nearest-neighbor rounding.