The mole fraction of ethanol is equal to the ratio of the number of moles of ethanol to the total number of moles present in the solution.
For dilute solutions, 1 L of water (or 1 L of solution) contains 100018=55.55 moles of water.
Let n be the number of moles of ethanol. The mole fraction of ethanol is 0.040.
Hence, 0.040=nn+55.55
n=0.040n+2.222
n=2.2221−0.040=2.31 moles.
The molarity of the solution is the ratio of the number of moles of solute present in 1 L of solution.
As 1 L of solution contains 2.31 moles of ethanol, the molarity of a solution is 2.31 M.