Assignment 1
Assignment 1
Examples:
1. Line Segment
Definition: A line segment connecting two points A and B is convex because for any t ∈
Mathematical Notation: For x1, x2∈Rn, the set {(1−t) x1+t x2 ∣ t ∈ [0,1]} is convex.
[0,1], the point P = (1 - t) A + t B lies on the line segment between A and B.
2. Circle
3. Triangle
Definition: A triangle with vertices A, B, and C is convex because for any two points
4. Square
Definition: A square (or rectangle) with side length a is convex, meaning that the line
5. Ellipse
Definition: An ellipse defined by the equation ¿ ¿ is convex because any line segment
Let’s break down the convex sets from the diagram, using their mathematical definitions and
explaining why each one is not convex.
1. Star-Shaped Polygon
Definition: A polygon with points that "dent" inward. In this shape, if you choose two
points inside, the line segment between them may exit the polygon.
Why Non-Convex: For some points A and B inside the polygon, the line segment
between them crosses outside the boundary. This violates the convex set definition.
Mathematical Explanation: If a polygon has interior angles greater than 180∘, it can be
non-convex because not all line segments between points in the set remain within the
polygon.
Definition: A crescent shape, like part of a circle with a curved gap. If you connect two
points across the gap, the line segment passes outside the set.
Why Non-Convex: Some lines between points on opposite sides of the gap go outside
the boundary, breaking the convexity rule.
line segment t x1 + (1−t) x2 (for t ∈ [0,1]) can pass outside the shape.
Mathematical Explanation: Let points x1 and x2 be on opposite sides of the gap. The
3. Hourglass Shape
Definition: An hourglass has a narrow middle where the shape "pinches" inward.
Connecting two points across this narrow area can cause the line to go outside the set.
Why Non-Convex: The inward pinch creates regions where line segments between
points inside the shape can pass through empty space.
Mathematical Explanation: For some pairs of points in opposite halves of the
hourglass, the straight line between them lies outside the shape, violating convexity.
4. Donut (Torus)
Definition: A donut-shaped set with a hole in the middle. A line connecting two points
on opposite sides of the hole will pass through empty space.
Why Non-Convex: The hole in the middle means line segments between points on either
side of the hole must pass through the empty region, making it non-convex.
tx1 + (1−t) x2 (for t ∈ [0,1] ) crosses outside the set, violating the convexity condition.
Mathematical Explanation: For points x1 and x2 on opposite sides of the hole, the line
5. Concave Polygon
Definition: A polygon with an indentation (a concave angle), meaning that at least one
internal angle is greater than 180∘. This creates a region where a line segment can pass
outside the polygon.
Why Non-Convex: The indentation means some line segments between points inside the
polygon pass through space outside the boundary.
Mathematical Explanation: For a concave polygon, certain points A and B inside the
polygon have a line segment between them that crosses the indentation, meaning the set
is not convex.
In each case, the shapes fail the convex set test because there are some pairs of points for which
the straight line connecting them lies outside the shape, which violates the fundamental condition
of convexity.
1. Take any two points x1, x2 ∈ A∩B. This means that x1 ∈ A and x2 ∈ A and also x1 ∈ B
and x2 ∈ B.
2. Since A is convex, for any λ ∈ [0,1],
λ x1 + (1−λ) x2 ∈ A
λ x1 + (1−λ) x2 ∈ B
The positive orthant in Rn is the set of all vectors in Rn where each component is non-negative.
It is given by:
In R2, this set corresponds to the first quadrant (where both x1 ≥ 0 x2 ≥ 0).
To prove that P is convex, we need to show that for any two points x1, x2 ∈ P and for any λ ∈
[0,1], the point
λ x1 + (1−λ) x2
also lies in P, meaning that all components of this new vector must be non-negative.
Proof:
1. Let x1 = (x11, x12, …, x1n) ∈ P and x2 = (x21, x22, …, x2n) ∈ P. By definition of P, for each i
=1,2, …, n, we have:
3. For each i = 1, 2, …, n, we know that both x1i ≥ 0 and x2i ≥ 0. Since λ ∈ [0,1], the
expression λ x1i + (1−λ) x2i is a convex combination of two non-negative numbers, so:
Since the convex combination of any two points in the positive orthant results in a point that is
still in the positive orthant, the set P is convex.
∥x – ∥ =∥ ∥ = ∥2x – w – z ∥2
w+ z 2 2 x−(w + z) 2 1
2 2 4
Expanding this:
Thus,
4∥x− ∥ = ∥ 2x – w – z ∥2
w+ z 2
2
LHS = ∥ z – w ∥2 + ∥ 2x – w – z ∥2
∥ 2x – w – z ∥2 = (2x – w – z) . (2x – w – z)
= 4 x.x – 2 x.w – 2x.z – 2 x.w + w.w + w.z – 2 x.z + w.z + z.z
= 4 x.x – 4x.w – 4 x.z + 2 w.z + w.w + z.z
= 4 x.x – 4 (x.w + x.z) + (w.w + 2 w.z + z.z )
Now
LHS = ∥ z – w ∥2 + ∥ 2x – w – z ∥2
LHS = (z.z – 2 z.w + w.w ) + (4 x.x – 4 (x.w + x.z)) + (w.w + 2 w.z + z.z )
we know that w.z = z.w
LHS = RHS
Which is required.
Q.4: Give an example of two convex functions whose sum is also a convex function.
f1(x) = x2 is convex because its second derivative is f ''1 (x) = 2 ≥ 0 for all x ∈ R.
f2(x) = 3x2 is also convex because its second derivative is f ''2 (x) = 6 ≥ 0 for all x ∈ R.
h′′(x) = 8 ≥ 0,
Proof: Let A and B be convex sets. We want to show that the intersection A∩B is convex.
1. Take any two points x1, x2 ∈ A∩B. This means that x1 ∈ A and x2 ∈ A and also x1 ∈ B
and x2 ∈ B.
2. Since A is convex, for any λ ∈ [0,1],
λ x1 + (1−λ) x2 ∈ A
λ x1 + (1−λ) x2 ∈ B
Q. 6: Let f(x) and g(x) are two continues function on C[a, b] s.t.
b
<f , g> = ∫ f ( x ) . g ( x ) dx
a
¿|f + g|¿ =¿
2
2π
¿ ∫ (sin ¿ ¿ 2 x +cos x +2 sinx cosx )dx ¿
2
2π
¿ ∫ ( 1+2 sin x cos x ) dx
0
2 2π
¿ x +sin x ¿0 = (2 π +0 ) −( 0+0 )=2 π
¿|f −g|¿ =¿
2
2π
¿ ∫ (sin ¿ ¿ 2 x +cos x−2 sinx cosx )dx ¿
2
2π
¿ ∫ ( 1−2 sin x cos x ) dx
0
2 2π
¿ x−sin x ¿ 0 =( 2 π −0 )− ( 0−0 )=2 π
f ((1 − t) c + t d) = (1 − t)2 c2 + 2 t (1 − t) cd + t2 d2
= (1 − t) c2 – t (1 − t) c2 + 2t (1 − t) cd + t2 d2
= (1 − t) c2 – t (1 − t) (c − d)2 + td
≤ (1 − t) c2 + td2