In Master and Commander when Lucky Jack is bearing down on the Acheron, I noticed one of the seaman - and going by the camera angles used we were meant to notice this - holding a rope which is dragging in the water as it slips through his hands. Another seaman has an hour glass and when the sand runs out he calls then the guy with the rope calls out the number of knots in the type have slipped through his hands (I think). Going by the context of the scene as a whole they are measuring speed but I want to know is exactly HOW exactly this works. I am guessing there is a weight on the end of the rope and the rope is a certain length and there is a certain distance between each knot. They must be an equation linked to this.
Yes, that is basically how it works.
Let me quote a well known web page:
Until the mid-19th century, vessel speed at sea was measured using a chip log. This consisted of a wooden panel, attached by line to a reel, and weighted on one edge to float perpendicularly to the water surface and thus present substantial resistance to the water moving around it. The chip log was "cast" over the stern of the moving vessel and the line allowed to pay out. Knots placed at a distance of 47 feet 3 inches (14.4018 m) passed through a sailor's fingers, while another sailor used a 30-second sand-glass (28-second sand-glass is the currently accepted timing) to time the operation. The knot count would be reported and used in the sailing master's dead reckoning and navigation. This method gives a value for the knot of 20.25 in/s, or 1.85166 km/h. The difference from the modern definition is less than 0.02%.
You can find images of the device on its page: