a. According to the given formula, to find the number of atoms of each element we have to take into account the coefficients and subscripts of the molecule.
There are 2 molecules of Ba(OH)2*8H2O.
In one molecule there is one Barium atom, 10 oxygen atoms (2 from the hydroxide and 8 from the water) and 18 hydrogen atoms (2 from the hydroxide and 16 from the water).
Since there are 2 molecules, we have to multiply all the numbers of atoms of each elements to determine the final answer:
Ba: 2 atoms.
O: 20 atoms
H: 36 atoms.
b. Using Avogadro's number we can find the number of moles that each number of atoms represent for each element:
[tex]Ba\to2mol\cdot\frac{6.023\times10^{23}atoms}{mol}=3.32\times10^{-24}atoms[/tex][tex]O\to20mol\cdot\frac{6.023\times10^{23}atoms}{mol}=3.32\times10^{-23}atoms[/tex][tex]H\to36mol\cdot\frac{6.023\times10^{23}atoms}{mol}=5.98\times10^{-23}atoms[/tex]