Wednesday Thursday Friday

All submissions for this problem are available.Darshan hates Mondays, Tuesdays, Saturdays, and Sundays. He loves Wednesdays, Thursdays, and Fridays. There are N college days left before the exams.Every day of the N days is a working college day even if it is a Sunday. Since he has to prepare for the exams, he is going to bunk all of the college days. What is the probability that he bunks on at least one of his favorite days?

Please Somebody teach me.I don’t understand.

Ok…I will.explain you …
https://www.codechef.com/viewsolution/25948281

See if the given n is greater than or equal to 7 then there is 1.000000 probability that one of his fav. Days must come

Now if n is 1 there are total 7 days and it’s fav . Days are 3 so prob. Is 3 / 7

Now if n is 2 the total pairs are Sunday -monday , monday-tuesday , tu-we,we-th,th-fr,fr-sat,sat-sun…total 7 pairs in which 4 pairs contain either wed, th, or Friday so prob. Is 4/7

Now if n is 3 total pairs are like 123 , 234 , 345 , 456 , 567 , 671 , 712 in which either 4 or 5 or 6 occur in 5 triplet so prob 5/7

Rest u solve…

Thank you for the Explanation.YOU MADE ME CLEAR

1 Like

Not 7…if N is greater than equal to 5 then also there’s 1.000000 probability.

1 Like

Yaa…my code also did same …but I just explain full Sol. Hope it helps…