I think the correct formula for q should be
q = ad + bc

By submitting this form, you accept the Mollom privacy policy.