How do I determine the average carbon oxidation numbers in ethanol and ethanal?
What you have been asked to calculate is what is called an average oxidation number. This is often used in inorganic chemistry (not because it is rather powerful, but because you can easily get away with it) but lesser in organic chemistry.

To properly determine oxidation states, you should do the calculation on a per-atom basis. And doing that would give you $\mathrm{-III}$ and $\mathrm{-I}$ for ethanol’s two carbons and $\mathrm{-III}$ and $\mathrm{+I}$ for ethanal’s. This method has a number of advantages:


you are always dealing with integers; no need for any fractional states
it is easy to see exactly which carbon’s oxidation state changed.


The downside of this method is that you cannot use it if you don’t know the structural formula. Consider if, for example, you only saw $\ce{C2H6O}$ or $\ce{C2H4O}$ — especially the first one could represent two different structures with different properties. This is were average oxidation states come in handy: you calculate an average of all the atoms of a single element. You may remember that oxygen is typically given $\mathrm{-II}$, hydrogen $\mathrm{+I}$ (except in peroxides and hydrides, respectively; although oxofluorides should get a special mention). You may also remember that the sum of oxidation states of a neutral compound must be $\pm 0$ that allows you to calculate the average oxidation states as follows:

$$\begin{align}\text{For }\ce{C2H6O}\text{:}&amp;\\
0 &amp;= 2 x + 6 \times (+1) + (-2)\\
0 &amp;= 2x + 6 - 2\\
0 &amp;= 2x + 4\\
-4 &amp;= 2x\\
x &amp;= -2\\
\\
\text{For }\ce{C2H4O}\text{:}&amp;\\
0 &amp;= 2 x + 4 \times (+1) + (-2)\\
0 &amp;= 2x + 4 - 2\\
0 &amp;= 2x + 2\\
-2 &amp;= 2x\\
x &amp;= -1\end{align}$$

Since these are averages, you can also arrive at the same conclusion by taking the arithmetic mean of all carbon atoms’ oxidation state; you will obviously arrive at the same result:

$$\begin{align}\ce{C2H6O}\text{:}&amp;\\
\bar{x} &amp;= \frac{-3 + (-1)}{2}\\
\bar{x} &amp;= \frac{-4}{2}\\
\bar{x} &amp;= -2\\
\\
\ce{C2H4O}\text{:}&amp;\\
\bar{x} &amp;= \frac{-3 + 1}{2}\\
\bar{x} &amp;= \frac{-2}{2}\\
\bar{x} &amp;= -1\end{align}$$