





"""simple docstring"""







from __future__ import annotations

import math
from collections import Counter
from string import ascii_lowercase







def     A__			(       __lowerCamelCase					):





  """simple docstring"""
  _lowerCAmelCase      ,   _lowerCAmelCase	      =					analyze_text(__lowerCamelCase					)
  _lowerCAmelCase	      =					list(' ' + ascii_lowercase					)
  # what is our total sum of probabilities.
  _lowerCAmelCase	      =					sum(single_char_strings.values()					)

  # one length string
  _lowerCAmelCase	      =					0
  # for each alpha we go in our dict and if it is in it we calculate entropy
  for ch in my_alphas:
    if ch in single_char_strings:
      _lowerCAmelCase	      =					single_char_strings[ch]
      _lowerCAmelCase	      =					my_str / all_sum
      my_fir_sum += prob * math.loga(__lowerCamelCase					)  # entropy formula.

    # print entropy
  print(F'''{round(-1 * my_fir_sum					):.1f}'''					)

  # two len string
  _lowerCAmelCase	      =					sum(two_char_strings.values()					)
  _lowerCAmelCase	      =					0
  # for each alpha (two in size) calculate entropy.
  for cha in my_alphas:
    for cha in my_alphas:
      _lowerCAmelCase	      =					cha + cha
      if sequence in two_char_strings:
        _lowerCAmelCase	      =					two_char_strings[sequence]
        _lowerCAmelCase	      =					int(__lowerCamelCase					) / all_sum
        my_sec_sum += prob * math.loga(__lowerCamelCase					)

    # print second entropy
  print(F'''{round(-1 * my_sec_sum					):.1f}'''					)

  # print the difference between them
  print(F'''{round((-1 * my_sec_sum) - (-1 * my_fir_sum)					):.1f}'''					)







def     A__			(       __lowerCamelCase					):





  """simple docstring"""
  _lowerCAmelCase	      =					Counter()  # type: ignore
  _lowerCAmelCase	      =					Counter()  # type: ignore
  single_char_strings[text[-1]] += 1

  # first case when we have space at start.
  two_char_strings[" " + text[0]] += 1
  for i in range(0,		len(__lowerCamelCase					) - 1					):
    single_char_strings[text[i]] += 1
    two_char_strings[text[i : i + 2]] += 1
  return single_char_strings, two_char_strings







def     A__			(       ):





  """simple docstring"""
  import doctest

  doctest.testmod()
  # text = (
  #     "Had repulsive dashwoods suspicion sincerity but advantage now him. Remark "
  #     "easily garret nor nay. Civil those mrs enjoy shy fat merry. You greatest "
  #     "jointure saw horrible. He private he on be imagine suppose. Fertile "
  #     "beloved evident through no service elderly is. Blind there if every no so "
  #     "at. Own neglected you preferred way sincerity delivered his attempted. To "
  #     "of message cottage windows do besides against uncivil.  Delightful "
  #     "unreserved impossible few estimating men favourable see entreaties. She "
  #     "propriety immediate was improving. He or entrance humoured likewise "
  #     "moderate. Much nor game son say feel. Fat make met can must form into "
  #     "gate. Me we offending prevailed discovery. "
  # )

  # calculate_prob(text)


if __name__ == "__main__":
   main()






'''simple docstring'''




from __future__ import annotations


def    lowerCamelCase__		(    SCREAMING_SNAKE_CASE   : int | float | str							, SCREAMING_SNAKE_CASE   : int | float | str    ):
  if nth_term == "":
    return [""]
  UpperCAmelCase    				=						int(SCREAMING_SNAKE_CASE    )
  UpperCAmelCase    				=						int(SCREAMING_SNAKE_CASE    )
  UpperCAmelCase    				=						[]
  for temp in range(int(SCREAMING_SNAKE_CASE    )    ):
    series.append(f'''1 / {pow(temp + 1							, int(SCREAMING_SNAKE_CASE    )    )}''' if series else '1'    )
  return series


if __name__ == "__main__":
  import doctest

  doctest.testmod()

  _a					:			List[Any]							=    int(input('Enter the last number (nth term) of the P-Series'))
  _a					:			Tuple							=    int(input('Enter the power for  P-Series'))
  print('Formula of P-Series => 1+1/2^p+1/3^p ..... 1/n^p')
  print(p_series(nth_term, power))


