Question
Quantitative Aptitude Question on Number of integer solutions
Let 0≤a≤x≤100 and f(x)=∣x−a∣+∣x−100∣+∣x−a−50∣.Then the maximum value of f(x) becomes 100 when a is equal to
Answer
We're given the function f(x)=∣x−a∣+∣x−100∣+∣x−a−50∣ and asked to find the value of a that maximizes f(x). We analyze three
cases for the possible values of x relative to a and a +50.
_1. _x≤a: Maximized at x =0.
_2. _a≤x≤a+50: Maximized at x =a.
_3. _x≥a+50: Maximized at x =100.
Comparing the maximum values in each case, we find that the maximum value of f(x) occurs in Case 1, where 2 a +150 is the expression for the
maximum value.
To maximize f(x), we need to maximize 2 a +150, which is achieved when a =100.
So, the maximum value of f(x) is 100, and it happens when a is equal to 100. Thus, the correct answer is:100