


from math import factorial







def SCREAMING_SNAKE_CASE	(			__lowerCAmelCase							,   __lowerCAmelCase				)    ->				int:

  # If either of the conditions are true, the function is being asked
  # to calculate a factorial of a negative number, which is not possible
  if n < k or k < 0:
    raise ValueError('''Please enter positive integers for n and k where n >= k'''				)
  return factorial(__lowerCAmelCase				) // (factorial(__lowerCAmelCase				) * factorial(n - k				))


if __name__ == "__main__":
   print(
       """The number of five-card hands possible from a standard""",
       F"""fifty-two card deck is: {combinations(5_2, 5)}\n""",
   )

   print(
       """If a class of 40 students must be arranged into groups of""",
       F"""4 for group projects, there are {combinations(4_0, 4)} ways""",
       """to arrange them.\n""",
   )

   print(
       """If 10 teams are competing in a Formula One race, there""",
       F"""are {combinations(1_0, 3)} ways that first, second and""",
       """third place can be awarded.""",
   )





import math
class 		__magic_name__						:





     '''simple docstring'''



     def 	SCREAMING_SNAKE_CASE__						(					self:Optional[int]     ,		_a:list[list[float]]     ,		_a:list[int]   ):
       snake_case__						= 0.0
       snake_case__						= 0.0
       for i in range(len(_a   )   ):
         da += math.pow((sample[i] - weights[0][i])     ,		2   )
         da += math.pow((sample[i] - weights[1][i])     ,		2   )
         return 0 if da > da else 1
       return 0







     def 	SCREAMING_SNAKE_CASE__						(					self:Tuple     ,		_a:list[list[int | float]]     ,		_a:list[int]     ,		_a:int     ,		_a:float   ):
       for i in range(len(_a   )   ):
         weights[j][i] += alpha * (sample[i] - weights[j][i])
       return weights







def SCREAMING_SNAKE_CASE	(			)    ->				None:
  # Training Examples ( m, n )
  snake_case__						= [[1, 1, 0, 0], [0, 0, 0, 1], [1, 0, 0, 0], [0, 0, 1, 1]]

  # weight initialization ( n, C )
  snake_case__						= [[0.2, 0.6, 0.5, 0.9], [0.8, 0.4, 0.7, 0.3]]

  # training
  snake_case__						= SelfOrganizingMap()
  snake_case__						= 3
  snake_case__						= 0.5

  for _ in range(__lowerCAmelCase				):
    for j in range(len(__lowerCAmelCase				)				):
      # training sample
      snake_case__						= training_samples[j]

      # Compute the winning vector
      snake_case__						= self_organizing_map.get_winner(__lowerCAmelCase							,   __lowerCAmelCase				)

      # Update the winning vector
      snake_case__						= self_organizing_map.update(__lowerCAmelCase							,   __lowerCAmelCase							,   __lowerCAmelCase							,   __lowerCAmelCase				)

    # classify test sample
  snake_case__						= [0, 0, 0, 1]
  snake_case__						= self_organizing_map.get_winner(__lowerCAmelCase							,   __lowerCAmelCase				)

  # results
  print(F"""Clusters that the test sample belongs to : {winner}"""				)
  print(F"""Weights that have been trained : {weights}"""				)


# running the main() function
if __name__ == "__main__":
   main()

