def       lowerCAmelCase_     (lowercase:							Tuple  ,					lowercase:							List[Any]		)    ->				Tuple:







 '''simple docstring'''
 _UpperCamelCase:     Tuple							= 0
 _UpperCamelCase:     Union[str, Any]							= len(snake_case__		) - 1

 while left <= right:
  # avoid divided by 0 during interpolation
  if sorted_collection[left] == sorted_collection[right]:
   if sorted_collection[left] == item:
    return left
   else:
    return None

  _UpperCamelCase:     int							= left + ((item - sorted_collection[left]) * (right - left)) // (
      sorted_collection[right] - sorted_collection[left]
  )

  # out of range check
  if point < 0 or point >= len(snake_case__		):
   return None

  _UpperCamelCase:     Tuple							= sorted_collection[point]
  if current_item == item:
   return point
  else:
   if point < left:
    _UpperCamelCase:     Tuple							= left
    _UpperCamelCase:     Dict							= point
   elif point > right:
    _UpperCamelCase:     Union[str, Any]							= right
    _UpperCamelCase:     Optional[int]							= point
   else:
    if item < current_item:
     _UpperCamelCase:     Any							= point - 1
    else:
     _UpperCamelCase:     Tuple							= point + 1
 return None




def       lowerCAmelCase_     (lowercase:							Optional[Any]  ,					lowercase:							int  ,					lowercase:							Union[str, Any]  ,					lowercase:							List[Any]		)    ->				Optional[Any]:







 '''simple docstring'''

 # avoid divided by 0 during interpolation
 if sorted_collection[left] == sorted_collection[right]:
  if sorted_collection[left] == item:
   return left
  else:
   return None

 _UpperCamelCase:     Optional[Any]							= left + ((item - sorted_collection[left]) * (right - left)) // (
     sorted_collection[right] - sorted_collection[left]
 )

 # out of range check
 if point < 0 or point >= len(snake_case__		):
  return None

 if sorted_collection[point] == item:
  return point
 elif point < left:
  return interpolation_search_by_recursion(snake_case__  ,					snake_case__  ,					snake_case__  ,					snake_case__		)
 elif point > right:
  return interpolation_search_by_recursion(snake_case__  ,					snake_case__  ,					snake_case__  ,					snake_case__		)
 else:
  if sorted_collection[point] > item:
   return interpolation_search_by_recursion(
       snake_case__  ,					snake_case__  ,					snake_case__  ,					point - 1		)
  else:
   return interpolation_search_by_recursion(
       snake_case__  ,					snake_case__  ,					point + 1  ,					snake_case__		)




def       lowerCAmelCase_     (lowercase:							Dict		)    ->				Dict:







 '''simple docstring'''
 if collection != sorted(snake_case__		):
  raise ValueError('''Collection must be ascending sorted'''		)
 return True


if __name__ == "__main__":
  import sys
  UpperCAmelCase_			    =							0
  if debug == 1:
    UpperCAmelCase_			    =							[1_0, 3_0, 4_0, 4_5, 5_0, 6_6, 7_7, 9_3]
    try:
      __assert_sorted(collection)
    except ValueError:
      sys.exit('''Sequence must be ascending sorted to apply interpolation search''')
    UpperCAmelCase_			    =							6_7

  UpperCAmelCase_			    =							interpolation_search(collection, target)
  if result is not None:
    print(f"""{target} found at positions: {result}""")
  else:
    print('''Not found''')
from __future__ import annotations

UpperCAmelCase_			    =							1.6_0_2_1E-1_9  # units = C




def       lowerCAmelCase_     (		lowercase:							float  ,					lowercase:							float  ,					lowercase:							float  ,					)    ->				tuple[str, float]:







 '''simple docstring'''
 if (conductivity, electron_conc, mobility).count(0		) != 1:
  raise ValueError('''You cannot supply more or less than 2 values'''		)
 elif conductivity < 0:
  raise ValueError('''Conductivity cannot be negative'''		)
 elif electron_conc < 0:
  raise ValueError('''Electron concentration cannot be negative'''		)
 elif mobility < 0:
  raise ValueError('''mobility cannot be negative'''		)
 elif conductivity == 0:
  return (
      "conductivity",
      mobility * electron_conc * ELECTRON_CHARGE,
  )
 elif electron_conc == 0:
  return (
      "electron_conc",
      conductivity / (mobility * ELECTRON_CHARGE),
  )
 else:
  return (
      "mobility",
      conductivity / (electron_conc * ELECTRON_CHARGE),
  )


if __name__ == "__main__":
  import doctest

  doctest.testmod()