Jump to content

Convex Combination

From Wikiversity
Visualization of a convex combination of degree 1., 2. and 3. in Geogebra 

Introduction

[edit | edit source]

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 vi∈V with i∈{1,…,n} equals 1:

v=λ1v1+λ2v2+⋯+λnvn=∑i=1nλivi,with0≤λi≤1,∑i=1nλi=1.

Convex combinations in the plane

[edit | edit source]

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:=(1−t) and λ2:=t, for example.

Convex combinations as mappings into vector space

[edit | edit source]

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

K(t):=(1−t)⋅v1+t⋅v2

Animation of a convex combination of two vectors as a figure

[edit | edit source]

convex combination as an illustration in a GIF animation


Convex combinations of 2 vectors in function spaces

[edit | edit source]

Treating convex combination with v1,v2∈ℝ2 or v1,v2∈ℝ3 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,g∈V:=𝒞([a,b],ℝ), then λ1,λ2∈[0,1] and λ1+λ2=1 give rise to a new function ht∈V with:

ht:=(1−t)⋅f+t⋅g

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

[edit | edit source]

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

f(x):=310⋅x2−2

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

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

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

Animation for convex combinations of functions

[edit | edit source]

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

[edit | edit source]

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

[edit | edit source]

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

[edit | edit source]

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

[edit | edit source]

Geogebra: Interactive applet - Download:' Geogebra-File

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

[edit | edit source]

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

[edit | edit source]

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

[edit | edit source]

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

A=(124),B=(410),K(t):=(1−t)⋅A+t⋅B=(B−A)⋅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

[edit | edit source]

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

H1=(222),K(1,1)(t):=(H1−A)⋅t+AK(1,2)(t):=(B−H1)⋅t+H1K2(t):=((H1−A)⋅t+A)⋅(1−t)+((B−H1)⋅t+H1)⋅t

Represent K2 as a polynomial K2(t)=P2⋅t2+P1⋅t1+P0⋅t0 and calculate for n=2 (n=3,4,...) the coefficients in Pk∈V=ℝ3.

Bernstein polynomial - order 1

[edit | edit source]
K1(t):=A⋅(1−t)+B⋅t=A⋅(1−t)1⋅t0+B⋅(1−t)0⋅t1

Calculation of the polynomial - order 2

[edit | edit source]
K2(t):=((H1−A)⋅t+A)⋅(1−t)+((B−H1)⋅t+H1)⋅t=(H1⋅t−A⋅t+A)−(H1⋅t2−A⋅t2+A⋅t)+(B⋅t2−H1⋅t2+H1⋅t)=(B−H1+A)⋅t2+2⋅(H1−A)⋅t+A

Bernstein polynomial - order 2

[edit | edit source]
K2(t):=((H1−A)⋅t+A)⋅(1−t)+((B−H1)⋅t+H1)⋅t=A⋅(1−t)2+2⋅H1⋅t⋅(1−t)+B⋅t2

Bernstein polynomial - order 3

[edit | edit source]
K3(t):=A⋅(1−t)3+3⋅H1⋅(1−t)2⋅t+3⋅H2⋅(1−t)⋅t2+B⋅t3

Task: calculation of the polynomial - order 3

[edit | edit source]
  • 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,…,Hn−1.
  • Prove your conjecture by complete induction.
Kn(t):=∑k=0n(nk)⋅Hk⋅tk⋅(1−t)n−k

Interactive geogebra worksheet

[edit | edit source]

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

[edit | edit source]

A convex combination can be used to interpolate points A=v1 and B=vn. Furthermore, if the auxiliary points H1=v2,....Hn1=vn−1 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]→ℝnt↦∑k=0n(1−t)n−k⋅tk⋅vk+1=(1−t)nv1+(1−t)n−1tv2+…+tnvn

Convex Combinations in Geogebra - Download

[edit | edit source]

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,v2∈ℝ2) are treated.


Definition of convex combinations as mappings/curves in vector space

[edit | edit source]

1st order convex combination

[edit | edit source]
  • 1st order convex combination generate all points on the connecting line between the two points v1,v2∈ℝ2.
K1:[0,1]→ℝ2,λ↦(1−λ)⋅v1+λ⋅v2.

2nd order convex combination

[edit | edit source]
  • A 2nd order convex combination arises with another auxiliary points h1∈ℝ2 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,h1∈ℝ2)
K1,2:[0,1]→ℝ2,λ↦(1−λ)⋅h1+λ⋅v2 (1st order convex combination between h1,v2∈ℝ2)
K2:[0,1]→ℝ2,λ↦(1−λ)⋅K1,1(λ)+λ⋅K1,2(λ) (2nd order convex combination. Order between v1,v2∈ℝ2 with auxiliary point h1∈ℝ2)

3rd order convex combination

[edit | edit source]

A 3rd order convex combination arises with two more auxiliary points h1,h2∈ℝ2 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,h1∈ℝ2)
K1,2:[0,1]→ℝ2,λ↦(1−λ)⋅h1+λ⋅h2 (1st order convex combination between h1,h2∈ℝ2)
K1,3:[0,1]→ℝ2,λ↦(1−λ)⋅h2+λ⋅v2 (1st order convex combination between h2,v2∈ℝ2)

2nd order convex combinations from 1st order KK

[edit | edit source]

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,h2∈ℝ2 with auxiliary point h1∈ℝ2)
K2,2:[0,1]→ℝ2,λ↦(1−λ)⋅K1,2(λ)+λ⋅K1,3(λ) (2nd order convex combination. Order between h1,v2∈ℝ2 with auxiliary point h2∈ℝ2)

3rd order convex combinations from 2nd order KK

[edit | edit source]

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,v2∈ℝ2 with auxiliary points h1,h2∈ℝ2)

Convex combinations of n-th order

[edit | edit source]

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

  • n−1 auxiliary points h1,…,hn1
  • n 1st order convex combinations,
  • n−1 2nd order convex combinations,
  • ...
  • n−k 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

[edit | edit source]

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λ:𝔻→Vz↦hλ(z):=(1−λ)⋅f(z)+λ⋅g(z)


Convex combinations of more than 2 vectors

[edit | edit source]

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

[edit | edit source]

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

λ1:=(1−t1),λ2:=t1⋅(1−t2),λ3:=t1⋅t2

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

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

Convex combinations of 4 vectors

[edit | edit source]

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

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

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

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


  • (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

[edit | edit source]
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

[edit | edit source]
  • (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

[edit | edit source]
  • (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

[edit | edit source]

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):=mk⋅x+bk. Here, the points 𝔻:={(x0,y0),…,(xn,yn)} are given data points that are interpolated piecewise using the functions fk(x):=mk⋅x+bk. Compute from the convex combinations Pk(t)∈ℝ2 the functional representation fk:[xk−1,xk]→ℝ with fk(x):=mk⋅x+bk:

Pk(t):=(1−t)⋅(xk−1yk−1)+t⋅(xkyk)

Calculation of t as a function of x

[edit | edit source]

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

T(x):=x−xk−1xk−xk−1

Calculation of the function value at x

[edit | edit source]

The convex combination

Pk(t):=(1−t)⋅(xk−1yk−1)+t⋅(xkyk)

gives the interpolation point of the graph. However, we only need the y-coordinate of the corresponding interpolation point Pk(t)=((1−t)⋅xk−1+t⋅xk(1−t)⋅yk−1+t⋅yk). So we use the following term: (1−t)⋅yk−1+t⋅yk.

Functional representation

[edit | edit source]

Substituting for t∈[0,1] gives the linear interpolation function fk:[xk−1,xk]→ℝ over:

fk(x):=(1−x−xk−1xk−xk−1⏟=t)⋅yk−1+(x−xk−1xk−xk−1⏟=t)⋅yk.

Learning Tasks

[edit | edit source]
  • Calculate the coefficients mk,bk∈ℝ of the function fk:[xk−1,xk]→ℝ with fk(x):=mk⋅x+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

[edit | edit source]

Interpolation with convex combination of order 3

See also

[edit | edit source]

References

[edit | edit source]
  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 )