Convex Combination

From testwiki
Revision as of 08:31, 7 December 2024 by imported>Eshaa2024
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
File:Geogebra convex ord3.png
Visualization of a convex combination of degree 1., 2. and 3. in Geogebra 

Introduction

Let (V,+,,) be a real vector space. A Linear combination is called a convex combination if all coefficients λi[0,1] are from the unit interval [0,1] and the sum of all λi for the vectors viV with i{1,,n} equals 1:

v=λ1v1+λ2v2++λnvn=i=1nλivi,with0λi1,i=1nλi=1.

Convex combinations in the plane

When considering convex combinations in the plane, the underlying vector space is the two-dimensional space V:=2. First, we consider convex combinations of two vectors in 2. By the condition λ1+λ2=1, both scalars are dependent on each other. If tis[0,1], then set λ1:=(1t) and λ2:=t, for example.

Convex combinations as mappings into vector space

Considering now a mapping K:[0,1]V, we can generally represent 1st order convex combinations of 2 vectors v1,v2V as follows over the mapping K:

K(t):=(1t)v1+tv2

Animation of a convex combination of two vectors as a figure

convex combination as an illustration in a GIF animation


Convex combinations of 2 vectors in function spaces

Treating convex combination with v1,v22 or v1,v23 provides an illustration in secondary school vector spaces as special linear combinations. However, convex combinations can also be applied to function spaces. For example, let f,gV:=𝒞([a,b],), then λ1,λ2[0,1] and λ1+λ2=1 give rise to a new function htV with:

ht:=(1t)f+tg

The subscript t in ht is used because a different function ht is defined as a function of t.

Example of convex combinations of functions

Let [a,b]=[4,7] and as the first function f:[a,b] a polynomial is defined.

f(x):=310x22

A trigonometric function g:[a,b] is chosen as the second function.

g(x):=2cos(x)+1

The following figure illustrates the convex combination K(t):=(1t)f+tg.

Animation for convex combinations of functions

The following animation shows several convex combinations of two given functions[1].

convex combination of two functions in geogebra

Geogebra: Interactive Applet - Download:' Geogebra-File

Remark - Deformation

If the first function f describes the initial shape and g describes the target shape, convex combinations can be described, for example, in computer graphics for the deformation of an initial shape into a target shape.

Convex combinations of convex combinations

In the animation above you can see a convex combination of 2 vectors viewed in the plane or in a function space. If one uses three points then one can create a 1st order convex combination between every two points. We will now consider higher order convex combinations by constructing, for example, a 2nd order convex combination from two 1st order convex combinations. Generally from 2 convex combinations of order n one convex combination of order n+1 can be formed.

Convex hull

The set of all convex combinations of a given set of vectors is called a convex hull (see also p-convex hull).

Video convex combinations in the plane

File:Convex combination geogebra.webm

Geogebra: Interactive applet - Download:' Geogebra-File

Remarks Video about convex combinations of order 1, 2 and 3 in Geogebra

In the video you can see convex combinations of the

  • 1st order between A1 and B1 without auxiliary points,
  • 2nd order between A2 and B2 with auxiliary point S1,
  • 3rd order between A3 and B3 with auxiliary points H1,H2,

Convex combinations as polynomials of t

Convex combinations can be conceived as polynomials where the coefficients come from a vector space (V,+,,) (see also Polynomial Algebra). For example, if one chooses V:=n, one can take a convex combination K to be an element of Polynomial Algebra V[t].

3D convex combination - 1st order

For example, choosing n=3 and V:=3, a 1st order convex combination is defined as follows.

A=(124),B=(410),K(t):=(1t)A+tB=(BA)t+A

Thus, a 1st order convex combination yields a polynomial of degree 1. with argument t. Represent the convex combination in Geogebra 3D with t[0,1] (see also Representation of a Straight Line by Direction Vector and Location Vector).

3D convex combination - 2nd order

Choosing again n=3 and V:=3 with an auxiliary point H1V, two 1st order convex combinations yield 2nd order convex combinations.

H1=(222),K(1,1)(t):=(H1A)t+AK(1,2)(t):=(BH1)t+H1K2(t):=((H1A)t+A)(1t)+((BH1)t+H1)t

Represent K2 as a polynomial K2(t)=P2t2+P1t1+P0t0 and calculate for n=2 (n=3,4,...) the coefficients in PkV=3.

Bernstein polynomial - order 1

K1(t):=A(1t)+Bt=A(1t)1t0+B(1t)0t1

Calculation of the polynomial - order 2

K2(t):=((H1A)t+A)(1t)+((BH1)t+H1)t=(H1tAt+A)(H1t2At2+At)+(Bt2H1t2+H1t)=(BH1+A)t2+2(H1A)t+A

Bernstein polynomial - order 2

K2(t):=((H1A)t+A)(1t)+((BH1)t+H1)t=A(1t)2+2H1t(1t)+Bt2

Bernstein polynomial - order 3

K3(t):=A(1t)3+3H1(1t)2t+3H2(1t)t2+Bt3

Task: calculation of the polynomial - order 3

  • Calculate the polynomial of degree 3 and derive from it the general formula for the coefficients of tn. To do this, use the notation H0:=A and Hn:=B for convex combinations of order n between points A and B with auxiliary points H1,,Hn1.
  • Prove your conjecture by complete induction.
Kn(t):=k=0n(nk)Hktk(1t)nk

Interactive geogebra worksheet

The video shows an interaction with the convex combinations above. From Geogebra, the worksheet created was uploaded to the Geogebra materials page. You can use this directly in your browser at the following link:

Interactive Worksheet: Convex Combination on Geogebra

Convex combination as a figure

A convex combination can be used to interpolate points A=v1 and B=vn. Furthermore, if the auxiliary points H1=v2,....Hn1=vn1 are given for a convex combination n-th order. The convex combinations can be generally thought of as mapping from the interval [0,1] to n as follows:

Kn:[0,1]ntk=0n(1t)nktkvk+1=(1t)nv1+(1t)n1tv2++tnvn

Convex Combinations in Geogebra - Download

In Geogebra, you can dynamically visualize the geometric meaning of convex combinations. At the

In the example files convex combinations of two points (vectors v1,v22) are treated.


Definition of convex combinations as mappings/curves in vector space

1st order convex combination

  • 1st order convex combination generate all points on the connecting line between the two points v1,v22.
K1:[0,1]2,λ(1λ)v1+λv2.

2nd order convex combination

  • A 2nd order convex combination arises with another auxiliary points h12 in the plane from the following two 1st order convex combinations:
K1,1:[0,1]2,λ(1λ)v1+λh1 (1st order convex combination between v1,h12)
K1,2:[0,1]2,λ(1λ)h1+λv2 (1st order convex combination between h1,v22)
K2:[0,1]2,λ(1λ)K1,1(λ)+λK1,2(λ) (2nd order convex combination. Order between v1,v22 with auxiliary point h12)

3rd order convex combination

A 3rd order convex combination arises with two more auxiliary points h1,h22 in the plane from the following three 1st order convex combinations:

K1,1:[0,1]2,λ(1λ)v1+λh1 (1st order convex combination between v1,h12)
K1,2:[0,1]2,λ(1λ)h1+λh2 (1st order convex combination between h1,h22)
K1,3:[0,1]2,λ(1λ)h2+λv2 (1st order convex combination between h2,v22)

2nd order convex combinations from 1st order KK

From the three 1st order convex combinations, construct two 2nd order convex combinations as follows:

K2,1:[0,1]2,λ(1λ)K1,1(λ)+λK1,2(λ) (2nd order convex combination. Order between v1,h22 with auxiliary point h12)
K2,2:[0,1]2,λ(1λ)K1,2(λ)+λK1,3(λ) (2nd order convex combination. Order between h1,v22 with auxiliary point h22)

3rd order convex combinations from 2nd order KK

From the two 2nd order convex combinations, a 3rd order convex combination is now obtained as follows:

K3:[0,1]2,λ(1λ)K2,1(λ)+λK2,2(λ) (2nd order convex combination. Order between v1,v22 with auxiliary points h1,h22)

Convex combinations of n-th order

In general, a convex combination of n-th order has.

  • n1 auxiliary points h1,,hn1
  • n 1st order convex combinations,
  • n1 2nd order convex combinations,
  • ...
  • nk convex combinations (k+1)-th order,
  • ...
  • 1 convex combination n-th order,

In 3D graphics, 3rd-order convex combinations are particularly important (see Bezier curves).

Convex combination of functions

Let 𝔻 be a domain of definition of functions and (V,+,,𝕂) be a vector space over the body 𝕂 (e.g. 𝕂:=, and 𝒞(𝔻,V) the set of continuous functions from 𝔻 to V. A convex combination of two continuous functions f,g𝒞(𝔻,V) with λ[0,1]𝕂 is defined by:

hλ:=(1λ)f+λg

Where

hλ:𝔻Vzhλ(z):=(1λ)f(z)+λg(z)


Convex combinations of more than 2 vectors

In the above case, two vectors from the underlying vector space were studied as convex combinations and higher order convex combinations were also constructed. Now the procedure is extended to more than 2 vectors, again using a parametrization over vectors (t1,,tn)[0,1]n.

Convex combinations of 3 vectors

Extend the approach to convex combination with two parameters t1,t2[0,1] and vectors v1,v2,v2 via:

λ1:=(1t1),λ2:=t1(1t2),λ3:=t1t2

and the mapping for the convex combinations into the closed triangle defined by the three vectors v1,v2,v2:

K3(t1,t2):=(1t1)=λ1v1+t1(1t2)=λ2v2+t1t2=λ3v3

Convex combinations of 4 vectors

For 4 vectors, again use as parameterization (t1,t2)[0,1]×[0,1]

λ1:=(1t1)(1t2),λ2:=t1(1t2),
λ3:=(1t1)t2,λ4:=t1t2

The mapping K4:[0,1]2V then represents all vectors from the convex hull of v1,v2,v3,v4V.

K4(t1,t2):=(1t1)(1t2)=λ1v1+t1(1t2)=λ2v2+(1t1)t2=λ2v3+t1t2=λ4v3


Task

  • (Geogebra) Analyze the Geogebra sample files and describe the importance of the auxiliary points for the shape of the locus line in the Dynamic Geometry Software (DGS) Geogebra.
  • What role do the auxiliary points play in creating differentiable interpolations (tangent vectors).
  • (Interpolation) Compare Lagrange or Newton interpolations for many data points with interpolation by several 3rd order convex combinations. What are the strengths and weaknesses (oscillation between data points) of the different methods. Veranschaulichen Sie diese mit Geogebra.

Task - 3. Order and functional representatio

K(t):= A * (1-t)^3 + H1 * (1-t)^2 * t + H2 * (1-t) * t^2 + B * t^3
Defination the poits as 3x1-Matrices with:
A : matrix( [-1], [3], [-4] )
  • (Differece between Convexcombination 3rd Order and cubic Splines)Analyze the similarities and differences between cubic splines and third-order convex combinations! What is the application context of cubic splines? When would you use convex combinations?

Learning Task - Convex combination of Functions

  • (Convex combination of Functions) Choose 𝔻:= V:= and represent the convex combination of f and g in Geogebra with a slider λ (analogous to the GIF animation), where f(x)=x2 and g(x)=cos(x). What do you observe when you move the slider from 0 to 1? g(x)=cos(x) is bounded and f(x)=x2 is unbounded on 𝔻:=. What is the property of hλ for 0<λ<1?
  • (Convex combinations and polynomialgebras) Summarize the convex combination of order n with coefficients from a vector space by powers of tn and consider the coefficients from the vector space V in general. How are the coefficients of the polynomials formed from the points or auxiliary points for the powers? (See also Polynomial algebra and Bezier curves).

Learning Task - Bernstein polynomials and de-Casteljau algorithm

  • (Bernstein polynomials) Analyze the connection of convex combinations as special linear combinations from linear algebra with Bernstein polynomials and Bezier curves. Bernstein polynomials for a certain degree n represent a decomposition of one. Which relation exists concerning a decomposition of one for convex combinations. What is the meaning of a polynomial representation with respect to a decomposition of one?
λ1++λn=k=1nλk=1

Interpolations

Convex combinations can also be used to interpolate polynomials. Start first with first order interpolations by interpolating the points with straight lines of the form fk(x):=mkx+bk. Here, the points 𝔻:={(x0,y0),,(xn,yn)} are given data points that are interpolated piecewise using the functions fk(x):=mkx+bk. Compute from the convex combinations Pk(t)2 the functional representation fk:[xk1,xk] with fk(x):=mkx+bk:

Pk(t):=(1t)(xk1yk1)+t(xkyk)

Calculation of t as a function of x

Given x[xk1,xk]. We now compute the corresponding t[0,1] for the convex combination with the preliminary consideration that t=0 for x=xk1 and t=1 for x=xk. The following figure takes the linear transformation T:[xk1,xk][0,1].

T(x):=xxk1xkxk1

Calculation of the function value at x

The convex combination

Pk(t):=(1t)(xk1yk1)+t(xkyk)

gives the interpolation point of the graph. However, we only need the y-coordinate of the corresponding interpolation point Pk(t)=((1t)xk1+txk(1t)yk1+tyk). So we use the following term: (1t)yk1+tyk.

Functional representation

Substituting for t[0,1] gives the linear interpolation function fk:[xk1,xk] over:

fk(x):=(1xxk1xkxk1=t)yk1+(xxk1xkxk1=t)yk.

Learning Tasks

  • Calculate the coefficients mk,bk of the function fk:[xk1,xk] with fk(x):=mkx+bk!
  • Transfer this interpolation to convex combination of order 3 and consider how, depending on the data points, you must choose the two auxiliary points of the interpolation so that the interpolation is differentiable and generates differentiable transitions between the interpolation points in the plot.
  • What geometric properties must auxiliary points between two adjacent interpolation intervals have for differentiability.

Interpolation with convex combination of order 3

Error creating thumbnail:

See also

References

  1. Bert Niehaus (2022) Convex combination of two functions in a vector space of functions - URL: https://www.geogebra.org/m/kkuufrck (Retrieved 14/01/2022 - 15:20 )


de:Konvexkombination