Mathematical model for pattern verification