In a 128 days time, each of 9 friends goes to gym on exactly 78 days. There are $n$ days on which at least 5 of the friends gym. Maximum and minimum possible value of n is ?
What i did was consider a set of $128$ elements each corresponding to one student which tells if he goes on {$day_{1},...day_{128}$} or not . Now we can choose pair of 5 students in $\binom{x}{5}$ ways where x is the number of students and we need this to be each pair goes to gym on n days so $n* \binom{x}{5}$ days but how to relate this with 78days so as to conclude for maximum and minimum values of n?
Let binary decision variable $x_{f,d}$ indicate whether friend $f$ goes to the gym on day $d$. Let binary decision variable $y_d$ indicate whether at least five friends go to the gym on day $d$. The problem is to maximize or minimize $\sum_d y_d$ subject to linear constraints \begin{align} \sum_d x_{f,d} &= 78 && \text{for all $f$} \tag1 \\ 5 y_d \le \sum_f x_{f,d} &\le 4 + 5 y_d &&\text{for all $d$} \tag2 \end{align} Constraint $(1)$ enforces the rule that each friend goes to the gym on exactly $78$ days. Constraint $(2)$ enforces $y_d = 1 \iff \sum_f x_{f,d} \ge 5$.
Summing $(2)$ over all $d$ yields $$5 \sum_d y_d \le \sum_d \sum_f x_{f,d} \le 128 \cdot 4 + 5 \sum_d y_d.$$ Applying $(1)$ now yields $$5 \sum_d y_d \le 9\cdot 78 \le 128 \cdot 4 + 5 \sum_d y_d,$$ from which we deduce bounds $$38 = \frac{9\cdot 78 - 128 \cdot 4}{5} \le \sum_d y_d \le \frac{9\cdot 78}{5} = 140.4.$$ The upper bound is redundant because we already know that $\sum_d y_d \le 128$.
It turns out that both $38$ and $128$ are attainable.