Q.
Seven people leave their bags outside temple and while returning after worshiping the deity, picked one bag each at random. In how many ways at least one and at most three of them get their correct bags?
No. of ways getting one correct =7C16!(1−1!1+2!1−3!1+…+6!1) =7C1⋅265
No. of ways getting two correct =7C2⋅5!(1−1!1+2!1−3!1+…−5!1) =7C2⋅44
No. of ways getting three correct =7C3⋅4!(1−1!1+2!1−3!1+4!1) =7C3⋅9
Required no. of ways =7C3⋅9+7C2⋅44+7C1⋅265