# Determinant of a Zeros and Ones matrices | Linear Algebra using Python

Linear Algebra using Python | Determinant of a Zeros and Ones matrices: Here, we are going to learn about the determinant of a zeros and ones matrices and its implementation in Python.
Submitted by Anuj Singh, on May 29, 2020

Prerequisites:

In linear algebra, the determinant is a scalar value that can be computed for a square matrix and represents certain properties of the matrix. The determinant of a matrix A is denoted det(A) or det A or |A|. There are matrices such as Zero and Ones matrices which have a constant determinant value and that is 0.

Using python library function, we will find the determinant of various zero and ones matrices.

## Python code for demonstrating the determinant of a zeros and ones matrices

```# Linear Algebra Learning Sequence
# Determinant of a Zeros and Ones matrices

import numpy as np

oneM = np.ones([4,4])
det_oneM = np.linalg.det(oneM)
zeroM = np.zeros([4,4])
det_zeroM = np.linalg.det(zeroM)

print("Ones Matrix: \n", oneM, "\nDeterminant : ", det_oneM)
print("\n\nZeros Matrix: \n", zeroM, "\nDeterminant : ", det_zeroM)
```

Output:

```Ones Matrix:
[[1. 1. 1. 1.]
[1. 1. 1. 1.]
[1. 1. 1. 1.]
[1. 1. 1. 1.]]
Determinant :  0.0

Zeros Matrix:
[[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]]
Determinant :  0.0
```

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates