Yes this is the approach that is expected (Most probably )and @rbaid yes u can extend this approach for k,k+1… iterate the same formula over k,k+1…
total = ncr(s-1,n-1)
for x in range (k,m):
if s-m >= n-1-x and m-1 >=x:
if n-1-x>=0:
result = result + (ncr(m-1,x)*ncr(s-m,n-1-x))
#print(result)
else:
break
print(result/total)
@rbaid >> in any case exactly one event will take place: either her k friends will go with her OR k+1 friends or k+2 friends … OR m friends, as the condition is at least k friends.
@rbaid
Expected : calculating the probability for which alice will be happy what u r calculating : probability that K of her friends will go for picnic
but she will be happy even if K+1 friends go for picnic and k+2… till M so just apply the same formula to calculate the probability and add them all
Ur formula is correct for k and it will be same for k+1 too