Random Number Generator

The Random Number Generator, or RNG, is the computing method that Golden Sun and Golden Sun: The Lost Age use to determine the occurrence of seemingly random events in the game, such as chance monster battles and the chances of said monsters dropping rare items. The games use separate RNG calculators for in battle and out of battle events.

GameFAQs has two guides (one for each game) detailing the system (these guide also contain pre-determined methods for obtaining items)

Manipulation
The Random Number Generator is not truly random, as it's name would suggest, and relies on player actions to determine the "random" events. As such, by utilizing the Random Number Generator, the game can be manipulated in a way to achieve a desired outcome (a monster dropping a rare item, for instance) one hundred percent of the time, if the correct methods are followed.

The Dark Panther Method
The Dark Panther Method, named after the first person to discover it, is a way to make rare item drops more common. It is often called the DP method or Djinn kill method. What it entails is:
 * Killing a monster with a Djinni.
 * The Djinni must be of the element that monster has the lowest resistance to; If a monster has 127 Venus resist, 100 each Mercury and Mars resist, and 48 Jupiter resist (In other words, the Mad Demon), you must kill it with a Jupiter Djinni.
 * The character that unleashes the Djinni must have a higher power in that element than the monster has resistance; not normally a problem, except with the Mad Demon. Often when killing the Mad Demon, it is necessary to have a Jupiter Adept unleash the fatal Djinni.

Example Method
Save the game and do a hard reset in the area where the monster that drops the item you need appears. Run around to get in a battle. If the encounter consists of a formation of 2 monsters, with at least one of them being the monster you want, proceed. If not, do another hard reset and try again.

During battle, have the entire party use multi-targetting Psynergy on the targets in the first turn, and since a battle right after a hard reset always involve your party attacking first where possible, the monsters will not be able to act. During the second turn, use two multi-targetting Psynergy on the enemies, and have the third party member (or fourth, if one of the three party members that act before uses Defend) unleash an attack Djinni of the element the monster is weak to on the monster. If by this point, the monster flashes in colour and dies, you will obtain the drop of that monster at the end of the battle, however rare it is. If the monster does not die then (either dies too soon or doesn't die by this step), adjust the power of your attacks until you get it just right.

This method works as long as your party members are all faster than your enemies, and there is no monster that can act multiple rounds per turn on the other side. You may also need to juggle Djinn around your party in order to make sure the member with the killing Djinni is slow enough to act third or last.

Analysis
The idea is that the game generates "random" numbers using a complicated formula. One of these formulas is used to determine monster drops, and it resets every time you turn the device off. This formula is actually not random at all; the first number generated will always be the same, and the second, third, fourth, fifth,and so on. It has been discovered that the 31st number generated will cause the monster to drop the item, if it is killed using the Dark Panther Method. Also, every move has a certain amount of "random" numbers it will use. In other words, if we know the exact random number value of every move, we can calculate exactly when to kill the monster to get the drop. An excellent and comprehensive guide on this topic, which also includes pre-made methods of getting most rare items, can be found here.