4 Application 2: pattern statistics