The dependence of time period T on the quantities `l, g` and `m` as a product may be written as :
`T=K l^(x) g^(y) m^(z)`
Where k is dimensionless constant and x, y and z are the exponents.
By considering dimensions on both sides, we have
`[L^(@)M^(@)T^(1)]=[L^(1)]^(x)[L^(1)T^(-2)]^(y) [M^(1)]^(z)`
`= L^(x+y) T^(-2y) M^(z)`
On equation the dimensions on both sides, we have
`x+y=0, -2y=1,` and `z=0`
So that `x=1/2, y=-1/2, z=0`
Then, `T=K l^(1//2) g^(-1///2)`
or, `T=ksqrt(l/g)`
Note that value of constant k can not be obtained by the method of dimensions. Here it does not matter if some number multiplies the right side of this formula, because that does not affect its dimensions.
Actually, `k=2pi` so that `T=2pi sqrt(l/g)`