Problem 1: Vector Addition and Scalar Multiplication
Easypython
Learn the Concept: Linear Algebra BasicsProblem Description
Write a Python program using NumPy that takes two vectors of the same length and a scalar value, then prints their element-wise sum and the result of multiplying the first vector by the scalar.
Input
Two vectors of equal length, and a scalar number.
Output
The resulting sum vector and the scaled vector.
Constraints
- Both vectors must have the same number of elements.
Example Input
textvector_a = [1, 2, 3], vector_b = [4, 5, 6], scalar = 2
Example Output
textSum: [5 7 9] Scaled Vector A: [2 4 6]
Concepts Covered
NumPy arrays, vector addition, scalar multiplication.
Related Problems
- Problem 2: Dot Product CalculatorEasy · pythonSolve Problem
- Problem 3: Matrix Multiplication CheckerEasy · pythonSolve Problem
- Problem 4: Transpose and Identity VerificationEasy · pythonSolve Problem