The number of permutations of letters a, b, c, d, e, f, g so that neither the pattern beg nor cad appears is
Total number of permutations = 7!
Let A be the property that ‘beg’ occurs.
B be the property that cad occurs.
Number of permutations with A = 5!
= that of with B and
Required number = 7! – 234 = 4806