For the first scenario, Ryan can pick 0, 1, or 2 non-fiction books. The remaining books will be fiction. So, the total number of ways is:
(Combination of 0 out of 10 non-fiction and 8 out of 9 fiction) + (Combination of 1 out of 10 non-fiction and 7 out of 9 fiction) + (Combination of 2 out of 10 non-fiction and 6 out of 9 fiction)
For the second scenario, Ryan can pick 3 to 8 non-fiction books. The remaining books will be fiction. So, the total number of ways is:
(Combination of 3 out of 10 non-fiction and 5 out of 9 fiction) + ... + (Combination of 8 out of 10 non-fiction and 0 out of 9 fiction)