# Adding Dimension to the Vector | Linear Algebra using Python

Linear Algebra using Python: In this article, we will learn about **adding dimension to the Vector**, python implementation of it.

Submitted by Anuj Singh, on May 12, 2020

Prerequisite: Linear Algebra | Defining a Vector

Vector dimensions are also an important aspect of linear algebra. We can add two vectors only and only if both the vectors are in the same dimensional space.

In the python code, we will add dimensions to the vector. If a vector is in 4-dimensional space and we want to further extend our vector in 7-dimensional space, that is we are adding a 3-dimensional component to our initial vector.

## Python code for Adding Dimension to the Vector

# Vectors in Linear Algebra a = [3, 5, -5, 8] b = [0, 0, 0] print("Vector a = ", a) # This is a 4-dimensional vector print("Vector a after dimensional addition = ", a + b) # This is now a 7-dimensional vector # in which the 5th, 6th and 7th component # are 0 the overall magnitude or length # of the vector is same

**Output**

Vector a = [3, 5, -5, 8] Vector a after dimensional addition = [3, 5, -5, 8, 0, 0, 0]

TOP Interview Coding Problems/Challenges

- Run-length encoding (find/print frequency of letters in a string)
- Sort an array of 0's, 1's and 2's in linear time complexity
- Checking Anagrams (check whether two string is anagrams or not)
- Relative sorting algorithm
- Finding subarray with given sum
- Find the level in a binary tree with given sum K
- Check whether a Binary Tree is BST (Binary Search Tree) or not
- 1[0]1 Pattern Count
- Capitalize first and last letter of each word in a line
- Print vertical sum of a binary tree
- Print Boundary Sum of a Binary Tree
- Reverse a single linked list
- Greedy Strategy to solve major algorithm problems
- Job sequencing problem
- Root to leaf Path Sum
- Exit Point in a Matrix
- Find length of loop in a linked list
- Toppers of Class
- Print All Nodes that don't have Sibling
- Transform to Sum Tree
- Shortest Source to Destination Path

Comments and Discussions

**Ad:**
Are you a blogger? Join our Blogging forum.