Explanation:
there are 10 3-day periods in 30 days.
at the end of each period the number of the day will be a multiple of 3 :
3, 6, 9, 12, ...
on which of these days will there be both practices ?
since swimming practice happens every second day, all these days are the even numbered days in these 30 days.
so, from the list of the multiples of 3, every other entry is an even number.
as mentioned, there are 10 entries, and half of them have an even number, so, the answer is 5.
on 5 days during that month he will have both practices on the same day.
a more mathematical, formal approach ?
finding the LCM, the lowest common multiple of the involved numbers/intervals.
we have 2-day intervals for swimming and 3-day intervals for baseball.
the lowest common multiple (= the lowest number that can be divided by both basic numbers without remainder) of 2 and 3 is 2×3 = 6, as 2 and 3 are already basic prime factors.
that means that the days of both practices happen at 6-day intervals.
there are 30/6 = 5 such intervals in a 30-day period.
=> it will happen on 5 days