Linear Algebra

Sort by

recency

|

306 Discussions

|

  • + 0 comments

    Working with determinants can feel repetitive at first, but once you understand the structure it becomes clearer, almost like how the story shared in About Our Pilates Center explains balance and precision as the core of every practic

  • + 0 comments

    For Python3 Platform

    import numpy
    
    N = int(input())
    A = numpy.array([input().split() for _ in range(N)], float)
    
    print(round(numpy.linalg.det(A), 2))
    
  • + 0 comments

    import numpy as np

    N = int(input()) M = np.array([input().split() for _ in range(N)],float)

    A = np.linalg.det(M)

    print(np.round(A,2))

  • + 0 comments
    import numpy as np
    N = int(input())
    A = np.array([input().split() for _ in range(N)],float)
    print(round(np.linalg.det(A),2))
    
  • + 0 comments

    import sys import numpy as np

    As usual with HackerRank problems, N is unnecessary.

    However, this time I felt like using it as an example

    of checking the input.

    print([(N := int(input())),

    np.linalg.det(np.loadtxt(sys.stdin.readlines(), float)[:N, :N]).round(2)][1])****