number of comparisons in searching algorithms
When measuring comparisons, we usually only charge comparisons of elements of the array (more accurately, we charge comparisons for the datatype of array elements, but not of array indices). In the example of linear search, at each iteration you are comparing one element of the array to the input element being searched. So in total, you are making exactly $n$ comparisons in the worst case.

For binary search, at each step you are making a 3-way comparison between the middle element of the current segment of the array and the input element. The number of 3-way comparisons satisfies the recurrence $T(n) \leq T(\lceil \frac{n-1}{2} \rceil) + 1$, with base case $T(1) = 1$ (when $n = 1$, you are making a 2-way comparison). If you are only allowing 2-way comparisons, then each 3-way comparison has to be simulated using two 2-way comparisons, which might be the reason why the recurrence has $+2$ instead of $+1$.

For ternary search, you are making two 3-way comparisons (comparing the two middle thirds to the input element), which translates to four 2-way comparisons.

(A 2-way comparison is one which has two outcomes: for example, "$x = y$?" is a 2-way comparison, as is "$x \leq y$?". A 3-way comparison is one which has three outcomes: given two elements $x,y$, the comparison tells you whether $x &lt; y$, or $x = y$, or $x &gt; y$.)