Master's Intelligence: 2d4+10 (12-18)
Master's Level: 2d8+4 (6-20)
Spell Book Contents
First Level Spells:
Determine spell quota by dividing INT by two (round up). This is the number of first level spells the Master's spell book will contain.
Automatically include Read Magic. Count Read Magic as the first spell towards reaching the quota (unless it is a zero-level spell in your system).
If your first level spells are divided into Offensive, Defensive and Miscellaneous spells, roll on each table in turn to select spells until the number of spells is met. Re-roll spells that are selected more than once.
If they are not divided into separate lists, roll to select spells until you have reached the quota. Re-roll spells that are selected more than once.
Second Level Spells and Higher:
Subtract one from the spell quota of the previous spell level and roll on spell list until quota is met, re-rolling spells that are selected more than once. Repeat for each spell level until the maximum spell level for the Master's level is reached or quota is lowered to zero.
For this first example, we'll use the LotFP (Deluxe) spell lists and Magic-User class. Note that LotFP doesn't divide first level spells into three separate lists of offensive, defensive and miscellaneous spells. Also, note that while this master is able to cast up to ninth level spells, she's only actually acquired spells up to sixth level. I'm rolling a d20 for each of these spell lists, since each of the LotFP spell lists I'm rolling on have 20 spells (higher-level spell lists have less).
Master's Intelligence: [1,1] 12
Master's Level: [6,7] 17
Quota: (12 divided by two) 6
Maximum Spell Level: 9th (but we're not going to get there)
First Level Spells:
Read Magic (automatic)
 Spider Climb
 Floating Disc
Second Level Spells:
 Audible Glamor
 Locate Object
 Continual Light
 Phantasmal Force
Third Level Spells:
 Hold Person
 Water Breathing
Fourth Level Spells:
 Charm Monster
 Wall of Ice
 Protection from Normal Weapons
Fifth Level Spells:
Sixth Level Spell:
 Legend Lore
For this second example, we'll use John's excellent Vancian spell lists, but only roll up the contents of the spell book through spell level two, since levels 3-6 work the same as level two. Note that John's spell lists count The Arcane Cypher (read magic) as a zero level spell and split the 30 first level spells into ten offensive, ten defensive and ten miscellaneous spells (so two rolls of "1" are fine, since they are rolls on different lists).
Zero Level Spell:
The Arcane Cypher (automatic)
First Level Spells (rolling 1d10):
 The Charm of Appersonation (Offensive)
 The Apotropaic Circle (Defensive)
 Tenser's Floating Disc (Miscellaneous)
 The Importunate Insult (Offensive)
 The Howling Rune (Defensive)
 The Call to the Unseen Servant (Miscellaneous)
Second Level Spells (rolling 1d30):
 The Pattern of the Immanent Sublime
 The Spell of Barring and Broaching
 The Spell of the Imponderous Bounty
 Leomund's Escalatory Escape
 Hornung's Deleterious Deflector