Dimensional analysis with height and time I'm very new to physic and I'm watching this physic lecture: https://www.youtube.com/watch?v=GtOGurrUPmQ&list=PLyQSN7X0ro203puVhQsmCj9qhlFQ-As8e&index=2 
at the 22:05 he talks about dimensional analysis.
there is an apple and we drop it from height h and we measure how long it takes to hit the ground which we call it t
then he says that $$ t \propto h^\alpha m^\beta g^ \gamma $$
then he talks about dimension
$$[T]^1 = [L]^\alpha [M]^\beta \frac{[L]^ \gamma}{[T]^ {2\gamma}}  $$
which if i understand correctly is the unit of the above statement. what i do not understand is that if my height is 3 meters then i square my height  $3^2$ = 6 meters for example the unit is the same so why the alpha in the first expression goes into the unit expression(the second expression)?
the first expression is kind of an equation of the time it takes for apple drop from height h to hit the ground at time t. for example if I square my height the function just return the $f(x^2)$ to me with the same unit(the unit will never change no matter what input I give to a function) the value that the function return will change not the unit.
I found a question about this story too Dimensional Analysis with $\alpha$, $\beta$, and $\gamma$ Powers
but this question do not ask the same question as I'm asking. Im asking about why you treat the unit statement as a function statement?
I mean in mathematic if you have a function f(x) and you square your x and put it into f(x) you get the same unit. The unit is not a function and the function is not a unit its a different story.
I feels like he transform a function into unit then calculate, then plug those units back into a function which seems invalid in mathematic.
Im very new to physic and I found physic world is so weird. can someone explain to me in very step by step and easy to understand with an example. Thank you.
 A: To do dimensional analysis you need to solve a 3×3 system of equations. In your case, you want to relate $t:[T]$, $h:[L]$, $m:[M]$ and $g:[L\, T^{-2}]$


*

*Choose one quantity that doesn't have an exponent. In your case it is time $t$. 

*Multiply all the quantities with the unknown exponents $\alpha$, $\beta$ and $\gamma$ and equal them to 1.
$$ t\,h^\alpha\,m^\beta\,g^\gamma = 1$$

*Take the above expression into units
$$ [T]\,[L]^\alpha\,[M]^\beta\,[L\,T^{-2}]^\gamma = 1$$

*Collect terms
$$ [L]^{\alpha+\gamma} \, [M]^\beta \, [T]^{1-2\gamma} = 1$$

*Only when the exponents of $[L]$, $[M]$, and $[T]$ are zero the expression can equal to 1.
$$ \pmatrix{\alpha + \gamma = 0 \\ \beta = 0 \\ 1-2 \gamma =0} \Rightarrow \pmatrix{\alpha = -\tfrac{1}{2}  \\ \beta= 0 \\ \gamma = \tfrac{1}{2} } $$

*Use the exponents in the original equation and solve for the quantity that didn't have an exponent:
$$ t\,h^{-\tfrac{1}{2}}\,m^0\,g^{\tfrac{1}{2}} = 1 \Rightarrow  t\, \sqrt{\frac{g}{h}}=1$$


The truth is that the above isn't he only expression that relates these quantities. All of the  following expressions are true. You can raise a dimensionless quantity to any power $\left( t\, \sqrt{\frac{g}{h}}=1 \right)^i$.
$$\array{ t \sqrt{ \frac{g}{h} } = 1 \\ t^2 \frac{g}{h}  = 1
\\ \frac{1}{t} \sqrt{\frac{h}{g}}=1  \\ \frac{h}{g t^2}=1}$$
That is why is best to keep the $=1$ on the right hand side, since it reminds you that the left hand side quantity is dimensionless.
And a dimensionless quantity you can use with mathematical functions such as $x^n$, $\ln(x)$, $\exp(x)$ so on.
This is important because you can only relate dimensionless quantities with mathematical functions. See the excellent answer to the recent question  Why is it “bad taste” to have a dimensional quantity in the argument of a logarithm or exponential function?.
So with the example above say you have two dimensionless quantities $x$ and $y$ that came out of dimensional analysis.
$$ \begin{aligned} x & = \frac{v}{g t} & y &  =\frac{h}{g t^2}  \end{aligned}$$ where $v$ is speed
Then the following expressions are dimensionally valid, although they might not make physical sense for this particular experiment. In theory, there could be other situations where they model that situation.
$$ \left. \matrix{
y = C_0 + C_1 x \\
y x = C_0 \\
y = C_0 \exp(\beta x) \\
y = C_0 + C_1 \ln(x)
} 
\right\} 
\matrix{
h = C_1 v t + C_0 g t^2  \\
  h = C_0 \frac{g^2 t^3}{v}  \\
 h = C_0\, g t^2 \exp{ \left( \frac{\beta v}{g t} \right)} \\
 h = g t^2 \left( C_0 + C_1 \ln \left( \frac{g t}{v} \right) \right)
}$$
So my rule is, any time you need to do a curve fit, or analytical modeling of a physical system, bring it down to dimensionless quantities  (using dimensional analysis) before applying any sort of mathematical expression between the quantities.
