Question
Using Python, in each of the parts below, use Julia to create the described vector a. In each case, check that a^Tx gives the correct
Using Python, in each of the parts below, use Julia to create the described vector a. In each case, check that a^Tx gives the correct result, for a random vector x.
(a) a^Tx extracts (is equal to) the 5th entry of the 10-vector x.
(b) a^Tx is the weighted average of a 3-vector x, assigning weights 0.3 to the first component, 0.4 to the second, and 0.3 to the third.
(c) a^Tx (with x a 22-vector) is the sum of xi for i a multiple of a 4, minus the sum of xi for i a multiple of 7.
(d) a^Tx (with x an 11-vector) is the average of the middle five entries of x,i.e., entries 4 to 8.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started