I'm trying to non-dimensionalise the equation for the mass-spring system $$m\ddot{y}+ky=0$$ I've made a list of the constants and their dimensions, including the one I've added which is $g$. $$\begin{array}{ll} \text{Constant} & \text{Dimension} \\ \hline m & \small[ M \small] \\ k & \small[ M T^{-2} \small] \\ g & \small[ L T^{-2} \small]\end{array}$$
As well as the list of the variables and their dimensions
$$\begin{array}{ll} \text{Variable} & \text{Dimension} \\ \hline t & \small[ T \small] \\ y & \small[ L \small] \end{array}$$
Now, I would like to introduce the dimensionless time, $\tau$. The problem is that I do not know how to combine the constants that I have to achieve that. I always have a dimension left, such as $L$, for example. Please advise.
PS This is not a homework assignment, just in case.
You set up a system of linear equations. Assuming your dimension labels are correct (which I think they are actually not, but I'll run with it), $m^{a_1} k^{a_2} g^{a_3} t^{a_4} y^{a_5}$ has dimensions $M^{a_1+a_2+a_3} T^{-2a_2-2a_3+a_4} L^{2a_2+a_3+a_5}$. The possible dimensionless quantities are those with the values of $a_i$ such that the exponents are all zero. So they satisfy:
$$a_1+a_2+a_3 = 0 \\ -2a_2-2a_3+a_4 = 0 \\ 2a_2 + a_3 + a_5 = 0.$$
There is a two dimensional subspace of such values of $a_i$ which you can find using Gaussian elimination.
For a dimensionless time, you would choose a particular solution to the above with $a_4=1$ (so that $\tau$ is proportional to $t$) and probably $a_5=0$ (so that $\tau$ is independent of $y$). With both these constraints, there is just one dimensionless time, up to a multiplicative constant.