The IUPAC name for compound (a) is 2-methylpentane.
For compound (b), the longest carbon chain has 6 carbon atoms, which corresponds to hexane.
For compound (b), there is a methyl group (-CH3) attached to the third carbon of the hexane chain.
Number the carbon chain from the end nearest to the substituent to give the substituent the lowest possible number. In this case, the methyl group is on the third carbon.
The IUPAC name for compound (b) is 3-methylhexane.