By "specific personalities" do you mean the Characteristic? This is where it says things like "loves to eat" or "strongly defiant." If so, the Characteristic is unrelated (well, not completely, but it is different) to the Personality Value. The characteristic is determined by the Pokemon's IV's (Individual Values). It simply indicates which IV is the highest.
Personality Value is basically a random number that determines things like Gender, Shininess, or what Wurmple evolves into. In Gen III ONLY it determined Unown's letter as well. Since Gen IV Unown's letter is completely separate from the Personality Value, and is basically a separate random number now.
So, in short, it is completely random. However, the maths side of Pokemon is quite complex, and goes far beyond EV training and IV breeding, which are all most players are familiar with.
Hope this helped (somewhat).
Sources: Unown, Personality Value, Characteristic