Find the probability of the event that number $1$ and number $7$ were chosen first and third, respectively at the experiment of choosing five numbers from this set of numbers $\{1,2,3,4,5,6,7,8,9\}$ if:
a) the choices are with replacement and order is count
b) the choices are without replacement and order is count
a) Size of sample space: $n(s)=9^5$ Size of the event $A$: $n(A)=9^3$
$$P(A)=\frac{n(A)}{n(s)}=\frac{9^3}{9^5}=\frac{1}{81}$$
For a) you are correct. Note that (particularly with replacement) you can neglect all the other picks and just say the probability is (pick 1 first)(pick 7 third)$=(\frac 19)^2=\frac 1{81}$
For b) again you can ignore the other picks-think of swapping the second and third picks. So you have $\frac 19$ to get the pick 1 first and $\frac 18$ to get the pick 7 (second/third) because 1 isn't available any more.