(2)
Ways of arranging 8 identical books in 4 identical shelves = {8, 0, 0, 0}, {7, 1, 0, 0}, {6, 2, 0, 0}, {5, 3, 0, 0}, {4, 4, 0, 0}, {6, 1, 1, 0},{5, 2, 1, 0}, {4, 3, 1, 0}, {4, 2, 2, 0}, {3, 3, 2, 0}, {5, 1, 1, 1}, {4, 2, 1, 1}, {3, 3, 1, 1}, {3, 2, 2, 1}, {2, 2, 2, 2}.
Number of ways = 15
[As shelves and books are identical, so the arrangements (5, 2, 1, 0), (2, 5, 1, 0), and (1, 2, 5, 0) are considered as same]