code: def discrete_binary_search(tab, lo, hi):
      
      while lo < hi:
          mid = lo + (hi - lo) // 2
          if tab[mid]:
              hi = mid
          else:
              lo = mid + 1
      return lo
docs: Binary search in a table
  
      :param tab: boolean monotone table with tab[hi] = True
      :param int lo:
      :param int hi: with hi >= lo
      :returns: first index i in [lo,hi] such that tab[i]
      :complexity: `O(log(hi-lo))`