solution:

By setting the radius of the wheel, you know the circumference of the wheel. The magnet/sensor combination works by counting the number of revolutions that the wheel makes. From this it computes a rotational velocity with the help of a clock (i.e. revolutions per second). Using the radius of the wheel it can find the tangential velocity ( tex2html_wrap_inline8 ). This is the velocity it displays on the screen.
For the distance it just counts the number of revolutions. Each revolution means that the bike had gone a distance tex2html_wrap_inline10 because that is how far any point on the wheel has moved in a circle, and since the wheels don't slip, the bike has moved that far. To find the total distance after "n" rotations, it's just tex2html_wrap_inline12 .
In both cases, the positioning of the magnet/sensor was not needed, as the total number and frequency of the revolutions are all that is needed given the radius of the wheel.