Q.
How many 7 digit number are there such that the digits are distinct integer taken from the set S={1,2,3,4,5,6,7,8,9} and such that the integer 5 and 6 do not appear consecutively in either order.
Total number of ways =9C7⋅7!
now there are 6 pairs of consecutive places e.g. ab, bc,...... when we can place 56 or 65 .
This can be done in 6⋅2=12 ways and remaining places can be filled in 7C5⋅5 !.
Here number of ways in which all the seven places can be filled with consecutive 65 or 56 =12⋅7C5⋅5 !
Hence the required number of ways =9C7⋅7!−(7C5⋅5!⋅12) =36⋅7!−2⋅6!⋅2!=6⋅6![42−7]=6⋅35⋅6!=151200