Capgemini
Company
Programming
Functions
Find min value of fn:
|-5-x| + |2-x|+|6-x|+10-x|; where x is an integer
0/17/23/19
Read Solution (Total 9)
-
- 19 say the lowest value we get from 2-x expression x is 2 then by putting it into the equation we get the minimum value
- 10 years agoHelpfull: Yes(7) No(0)
- ans:-19
we have to put x=2,5,6 or 10 so that we can eliminate one term.
if we put x=2 or 5 or 6 then ans is 19 which is minimum
for other values of x we get ans greater than 19.
hence ans should be 19. - 10 years agoHelpfull: Yes(3) No(0)
- The answer is 19. Just make a graph or use inequalities.
| -5 - x | + | 2 - x | + | 6 - x | + | 10 - x | =
| 5 + x | + | x - 2 | + | 6 - x | + | 10 - x | >=
| (5 + x) + (x - 2) + (6 - x) + (10 - x)| = 19.
This means the minimum can not be 0 or 17, so it is either 19 or 23. Since equality holds when x = 2, 19 is in fact the minimum. - 9 years agoHelpfull: Yes(3) No(0)
- if we take x=0 (0 is also an integer)
than its ans is 23 - 10 years agoHelpfull: Yes(2) No(3)
- For the function to be minimum , value of |-5-x| + |2-x|+|6-x|+10-x| should be zero and it does not mean x has to be zero.
Answer = 0 - 10 years agoHelpfull: Yes(1) No(3)
- which is the corrct answer?? 0 or 19........explain clearly
- 10 years agoHelpfull: Yes(1) No(0)
- 23-2x t hen put x=0....gives 23
- 10 years agoHelpfull: Yes(0) No(0)
- verify from options as all are values, i got min value for fn with x=0.
- 9 years agoHelpfull: Yes(0) No(0)
- By using heat and trial,by making one mod value=0;
ans=>19 - 5 years agoHelpfull: Yes(0) No(0)
Capgemini Other Question