Thread: Linear algebra - piecewise linear with 6 unkowns, find expression by line segment

1. Linear algebra - piecewise linear with 6 unkowns, find expression by line segment

Got this question in a paper recently and I find it a little confusing as to how to kick it off.. any tips?

A piece-wise linear function passes through 4 points (x,Y(x)). for x=1,2,3,4... 3 line segments denoted by ;

a+bx, c+dx, e+ fx,

Give 6 equations that satisfy a,b,c,d,e,f?

2. Re: Linear algebra - piecewise linear with 6 unkowns, find expression by line segment

Please post the full problem. What you have written up is a partial problem that appears to be missing some key instruction that will make the problem meaningful.

3. Re: Linear algebra - piecewise linear with 6 unkowns, find expression by line segment

Originally Posted by Njords
Got this question in a paper recently and I find it a little confusing as to how to kick it off.. any tips?

A piece-wise linear function passes through 4 points (x,Y(x)). for x=1,2,3,4... 3 line segments denoted by ;

a+bx, c+dx, e+ fx,

Give 6 equations that satisfy a,b,c,d,e,f?
You don't really have "6 equations in 6 unknowns" because the six equation can be taken in pairs- you have three separate problems, each involving two equations in two unknowns.

Of course, this depends upon what the "Y(x)" values are. Taking them simply to be (1, Y(1)), (2, Y(2)), (3, Y(3)), and (4, Y(4)) then a, b, c, d, e, and f will depend upon Y(1), Y(2), Y(3), and Y(4).

The first line segment must be of the form y= ax+ b and must pass through (1, Y(1)) and (2, Y(2)). Setting x= 1, y= Y(1) in ax+ b we have Y(1)= a+ b. Setting x= 2, y= Y(2), we have Y(2)= 2a+ b. We have two equations to solve for a and b. Since b has coefficient 1 in both equations, we can eliminate b by subtracting the first equation from the second: Y(2)- Y(1)= 2a+ b- a- b= a. Setting a= Y(2)- Y(1) in Y(1)= a+ b we have Y(1)= Y(2)- Y(1)+ b so b= Y(1)- Y(2)+ Y(1)= 2Y(1)- Y(2). The first equation, y= ax+ b, is y= (Y(2)- Y(1))x+ 2Y(1)- Y(2).

Check: when x= 1, y= (Y(2)- Y(1))(1)+ 2Y(1)- Y(2)= Y(2)- Y(1)+ 2Y(1)- Y(2)= Y(1). When x= 2, y= (Y(2)- Y(1))(2)+ 2Y(1)- Y(2)= 2Y(2)- 2Y(1)+ 2Y(1)- Y(2)= Y(2).

The second line segment must pass through (2, Y(2)) and (3, Y(3) and we want it of the form y= cx+ d. Setting x= 2, y= Y(2) in that, Y(2)= 2c+ d and Y(3)= 3c+ d. Again subtracting the first equation from the second eliminates d and gives Y(3)- Y(2)= c. Then Y(2)= 2c+ d= 2(Y(3)- Y(2))+ d= 2Y(3)- 2Y(2)+ d so d= Y(2)- 2Y(3)+ 2Y(2)= 3Y(2)- 2Y(3). y= cx+ d becomes y= (Y(3)- Y(2))x+ (3Y(2)- 2Y(3)).

Check: When x= 2, y= (Y(3)- Y(2))(2)+ (3Y(2)- 2Y(3))= 2Y(3)- 2Y(2)+ 3Y(2)- 2Y(3)= Y(2). When x= 3, y=(Y(3)-Y(2))(3)+ (3Y(2)- 2Y(3))= 3Y(3)- 3Y(2)+ 3Y(2)- 2Y(3)= Y(3).

The third line segment must pass through (3, Y(3)) and (4, Y(4)) and you want it of the form y= ex+ f. Setting x= 3, y= Y(3) in that equation, Y(3)= 3e+ f. Setting x= 4, y= Y(4) in that equation, Y(4)= 4e+ f. Subtracting the first equation from the second, e= Y(4)- Y(3). Then Y(3)= 3(Y(4)- Y(3))+f= 3Y(4)- 3Y(3)+ f so f= Y(3)- 3Y(4)+ 3Y(3)= 4Y(3)- 3Y(4). The equation is y= (Y(4)- Y(3))x+ (4Y(3)- 3Y(4)).

Check: When x= 3, y= (Y(4)- Y(3))(3)+ (4Y(3)- 3Y(4))= 3Y(4)- 3Y(3)+ 4Y(3)- 3Y(4)= Y(3). When x= 4. y= (Y(4)- Y(3))(4)+ (4Y(3)- 3Y(4))= 4Y(4)- 4Y(3)+ 4Y(3)- 3Y(4)= Y(4).

4. Re: Linear algebra - piecewise linear with 6 unkowns, find expression by line segment

Originally Posted by SlipEternal
Please post the full problem. What you have written up is a partial problem that appears to be missing some key instruction that will make the problem meaningful.
That's all that's given for the first part. From there the next parts b) & c) of the paper ask to put the 6 equations in an augmented matrix, then put in reduced row echelon form and then give values for a,b,c,d,e,f.
I feel fairly comfortable with b) & c) if I were to get there. However, part a) as written in the OP is what's got me stumped.

5. Re: Linear algebra - piecewise linear with 6 unkowns, find expression by line segment

Originally Posted by Njords
That's all that's given for the first part. From there the next parts b) & c) of the paper ask to put the 6 equations in an augmented matrix, then put in reduced row echelon form and then give values for a,b,c,d,e,f.
I feel fairly comfortable with b) & c) if I were to get there. However, part a) as written in the OP is what's got me stumped.
I can see why you are stumped. While HallsofIvy is inferring a relationship between the three lines and the piecewise linear function, the problem does not make this relationship apparent. Is it saying that on the interval $[1,2]$, the function satisfies the equation $y=ax+b$? Then on the interval $[2,3]$, the function satisfies the equation $y=cx+d$, and finally on the interval $[3,4]$, the function satisfies the equation $y=ex+f$? Because that is not what the problem states as it is written. I, personally, would say that this is not a problem that is possible to solve, but here goes:

$f(x) = \begin{cases}a+b & x \le 1 \\ ax+b & 1\le x \le 2 \\ cx+d & 2 \le x \le 3 \\ ex+f & 3 \le x \le 4 \\ 4e+f & 4 \le x\end{cases}$

That is a possibility. Now, write up five more possible piecewise linear functions (by changing the initial line or the last line).

6. Re: Linear algebra - piecewise linear with 6 unkowns, find expression by line segment

The "augmented matrix" would be $\displaystyle \begin{bmatrix} 1 & 1 & 0 & 0 & 0 & 0 & Y(1) \\ 2 & 1 & 0 & 0 & 0 & 0 & Y(2) \\ 0 & 0 & 2 & 1 & 0 & 0 & Y(2) \\ 0 & 0 & 3 & 1 & 0 & 0 & Y(3) \\ 0 & 0 & 0 & 0 & 3 & 1 & Y(3) \\ 0 & 0 & 0 & 0 & 4 & 1 & Y(4) \end{bmatrix}$.

7. Re: Linear algebra - piecewise linear with 6 unkowns, find expression by line segment

Originally Posted by SlipEternal
I can see why you are stumped. While HallsofIvy is inferring a relationship between the three lines and the piecewise linear function, the problem does not make this relationship apparent. Is it saying that on the interval $[1,2]$, the function satisfies the equation $y=ax+b$? Then on the interval $[2,3]$, the function satisfies the equation $y=cx+d$, and finally on the interval $[3,4]$, the function satisfies the equation $y=ex+f$? Because that is not what the problem states as it is written. I, personally, would say that this is not a problem that is possible to solve, but here goes:

$f(x) = \begin{cases}a+b & x \le 1 \\ ax+b & 1\le x \le 2 \\ cx+d & 2 \le x \le 3 \\ ex+f & 3 \le x \le 4 \\ 4e+f & 4 \le x\end{cases}$

That is a possibility. Now, write up five more possible piecewise linear functions (by changing the initial line or the last line).
I do believe for the interval [1,2] it should satisfy a+bx and so on, but then as it's written I end up second guessing myself. I don't know why papers sometimes are written with such ambiguous wording like they are at times... I may have been looking at it too long and reached a point where I can brain no more.

Originally Posted by HallsofIvy
The "augmented matrix" would be $\displaystyle \begin{bmatrix} 1 & 1 & 0 & 0 & 0 & 0 & Y(1) \\ 2 & 1 & 0 & 0 & 0 & 0 & Y(2) \\ 0 & 0 & 2 & 1 & 0 & 0 & Y(2) \\ 0 & 0 & 3 & 1 & 0 & 0 & Y(3) \\ 0 & 0 & 0 & 0 & 3 & 1 & Y(3) \\ 0 & 0 & 0 & 0 & 4 & 1 & Y(4) \end{bmatrix}$.

SlipEternal & HallsofIvy, your help is greatly appreciated. Thanks very much both of you.