The simple solution to this problem is to ban pilots under 35 from flying because they're too young and inexperienced, and then to ban all pilots over 40 from flying because at 40 one is on the downhill slide. This would get all the old farts off the flight deck.
On the other hand we could prevent all aircraft accidents, 100%, by grounding all aircraft.