solved prob 7 of hw 1