x is distance and y is cost because the cost is dependent on the distance which makes the distance the independent variable. you can always use y=mx+b for these problems!!
Each 1 biography has 5 possible mystery novels to choose from so, for each 6 books you could choose out of 5 possible mystery books and with that being said, 5 × 6 = 30