
'''simple docstring'''







import numpy as np







def   lowerCAmelCase(  a__    :  Tuple      ):







       '''simple docstring'''






       lowerCamelCase__   ,		lowerCamelCase__				   =      a.shape
       lowerCamelCase__				   =      min(a__      , a__      )
       lowerCamelCase__				   =      np.eye(a__      )
       lowerCamelCase__				   =      a.copy()

       for k in range(t - 1      ):
              # select a column of modified matrix A':
              lowerCamelCase__				   =      r[k:, [k]]
              # construct first basis vector
              lowerCamelCase__				   =      np.zeros_like(a__      )
              lowerCamelCase__				   =      1.0
              # determine scaling factor
              lowerCamelCase__				   =      np.linalg.norm(a__      )
              # construct vector v for Householder reflection
              lowerCamelCase__				   =      x + np.sign(x[0]      ) * alpha * ea
              v /= np.linalg.norm(a__      )

              # construct the Householder matrix
              lowerCamelCase__				   =      np.eye(m - k      ) - 2.0 * v @ v.T
              # pad with ones and zeros as necessary
              lowerCamelCase__				   =      np.block([[np.eye(a__      ), np.zeros((k, m - k)      )], [np.zeros((m - k, k)      ), q_k]]      )

              lowerCamelCase__				   =      q @ q_k.T
              lowerCamelCase__				   =      q_k @ r

       return q, r


if __name__ == "__main__":
    import doctest

    doctest.testmod()



'''simple docstring'''







def   lowerCAmelCase(  a__    :  float      , a__    :  float      , a__    :  int      ):







       '''simple docstring'''






       lowerCamelCase__				   =      [1 / first_term]
       lowerCamelCase__				   =      1 / first_term
       for _ in range(number_of_terms - 1      ):
              first_term += common_difference
              arithmetic_progression.append(a__      )
       lowerCamelCase__				   =      [1 / step for step in arithmetic_progression]
       return sum(a__      )


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    print(sum_of_harmonic_progression(1 / 2, 2, 2))

