This part is really confusing to me. It looks like you want people's spells known to be randomly selected from their list. I don't like that, but whatever. The confusing part is that 5d10 does not give you a range of 1-50. It gives 5-50, with 27.5 being the most likely result and more extreme results being less common. If you wanted every spell to be equally likely to be known, you could try 1d100/2 five times for your five spells.