Answer:
Part a: If the list contains n elements (where n is odd) the middle term is at index (n-1)/2 and the number of comparisons are (n+1)/2.
Part b: If the list contains n elements (where n is even) the middle terms are at index (n-2)/2 & n/2 and the number of comparisons are (n+2)/2.
Part c: The average number of comparisons for a list bearing n elements is 2n+3/4 comparisons.
Explanation:
Suppose the list is such that the starting index is 0.
Part a
If list has 15 elements, the middle item would be given at 7th index i.e.
there are 7 indices(0,1,2,3,4,5,6) below it and 7 indices(8,9,10,11,12,13,14) above it. It will have to run 8 comparisons to find the middle term.
If list has 17 elements, the middle item would be given at 8th index i.e.
there are 8 indices(0,1,2,3,4,5,6,7) below it and 8 indices(9,10,11,12,13,14,15,16) above it.It will have to run 9 comparisons to find the middle term.
If list has 21 elements, the middle item would be given at 10th index i.e.
there are 10 indices (0,1,2,3,4,5,6,7,8,9) below it and 10 indices (11,12,13,14,15,16,17,18,19,20) above it.It will have to run 11 comparisons to find the middle term.
Now this indicates that if the list contains n elements (where n is odd) the middle term is at index (n-1)/2 and the number of comparisons are (n+1)/2.
Part b
If list has 16 elements, there are two middle terms as one at would be at 7th index and the one at 8th index .There are 7 indices(0,1,2,3,4,5,6) below it and 7 indices(9,10,11,12,13,14,15) above it. It will have to run 9 comparisons to find the middle terms.
If list has 18 elements, there are two middle terms as one at would be at 8th index and the one at 9th index .There are 8 indices(0,1,2,3,4,5,6,7) below it and 8 indices(10,11,12,13,14,15,16,17) above it. It will have to run 10 comparisons to find the middle terms.
If list has 20 elements, there are two middle terms as one at would be at 9th index and the one at 10th index .There are 9 indices(0,1,2,3,4,5,6,7,8) below it and 9 indices(11,12,13,14,15,16,17,18,19) above it. It will have to run 11 comparisons to find the middle terms.
Now this indicates that if the list contains n elements (where n is even) the middle terms are at index (n-2)/2 & n/2 and the number of comparisons are (n+2)/2.
Part c
So the average number of comparisons is given as
((n+1)/2+(n+2)/2)/2=(2n+3)/4
So the average number of comparisons for a list bearing n elements is 2n+3/4 comparisons.