The way in which ratios are worked out is quite simple. In most cases cyclists will however, talk in gear inches.
To work out the ratio simply divide the number of teeth selected on the front sprocket by the number of teeth being used on the rear sprocket. So for example if you are riding on a front sprocket with 42 teeth, and are using a rear sprocket of say 15 teeth, then the ratio is 42 divided by 15 which would give a ratio of 2.8
If you wanted to express this in gear inches, then the diameter of the wheel comes into the equation. So keeping the same selected cogs stated above, and riding on 26" wheels, the equation would be:
42 divided by 15 x26. The gear inches would be 72.8"
If you consider the road bikes in the Tour De France as another example, then a rider racing on a front sprocket with 52 teeth, and a rear sprocket of 11 teeth on 27" wheels would be pushing massive gear inches, 52 divided by 11 x27 which equals 127.6 gear" Fit men are they not.
I hope this helps.