# Worksheet 6-1: Convex Sets

Download: [CMSE382-WS6_1.pdf](CMSE382-WS6_1.pdf)

```{warning}
This is an AI-generated transcript of the worksheet and may contain errors or inaccuracies. Please refer to the original course materials for authoritative content.
```

---

## Worksheet 6-1: Q1

Let $\mathbf{x}_1 = (2,3)^\top$ and $\mathbf{x}_2 = (1,4)^\top$.

1. Write the equation of the line passing through $\mathbf{x}_1$ and $\mathbf{x}_2$ as a function of $\lambda$:

   $$\mathbf{x}(\lambda) = (1-\lambda)\mathbf{x}_1 + \lambda \mathbf{x}_2$$

2. For each value of $\lambda$ below, compute the point $\mathbf{x}(\lambda)$ and state whether it lies on the **segment** between $\mathbf{x}_1$ and $\mathbf{x}_2$, or outside it:

   | $\lambda$ | $\mathbf{x}(\lambda)$ | On segment? |
   |---|---|---|
   | $\lambda = 0$ | | |
   | $\lambda = 1/2$ | | |
   | $\lambda = 1$ | | |
   | $\lambda = 2$ | | |

---

## Worksheet 6-1: Q2

For each of the following sets, determine whether it is **convex** or **not convex**.

(a) A finite set of points $S = \{p_1, p_2, \ldots, p_k\} \subset \mathbb{R}^n$ (with $k \ge 2$).

(b) The nonnegative orthant $\mathbb{R}^2_+ = \{(x,y) \mid x \ge 0, y \ge 0\}$ (shown below).

$$\includegraphics[width=0.25\textwidth]{../../../figures/Rplus.png}$$

```{image} ../../../figures/Rplus.png
:width: 200px
:align: center
```

(c) The set $\{(x,y) \mid xy = 0\}$ (axes, or "L-shape"):

(d) The set shown below (defined by a nonlinear inequality):

```{image} ../../../figures/nonconvex.png
:width: 250px
:align: center
```

(e) The $\ell_1$, $\ell_2$, and $\ell_\infty$ unit balls in $\mathbb{R}^2$:

```{image} ../../../figures/unit_ball_examples_R2.png
:width: 350px
:align: center
```

---

## Worksheet 6-1: Q3

(a) Draw an example of a **union of two convex sets** that is **not convex**.

(b) Draw an example of a **union of two convex sets** that **is convex**.

---

## Worksheet 6-1: Q4

Let $S = \{(1,1), (2,2), (3,1)\}$.

1. Sketch the convex hull $\text{conv}(S)$.

2. For each of the following points, find $\lambda_1, \lambda_2, \lambda_3 \ge 0$ with $\lambda_1+\lambda_2+\lambda_3=1$ such that $\mathbf{x} = \lambda_1(1,1)+\lambda_2(2,2)+\lambda_3(3,1)$:

   | Point $\mathbf{x}$ | $\lambda_1$ | $\lambda_2$ | $\lambda_3$ |
   |---|---|---|---|
   | $(2,2)$ | | | |
   | $(2,1.5)$ | | | |
   | $(1.5, 1.5)$ | | | |
   | $(2, 1)$ | | | |

3. For each set of coefficients below, identify the corresponding point:

   | $\lambda_1$ | $\lambda_2$ | $\lambda_3$ | Point $\mathbf{x}$ |
   |---|---|---|---|
   | $1/3$ | $1/3$ | $1/3$ | |
   | $1/2$ | $0$ | $1/2$ | |
   | $0$ | $1/4$ | $3/4$ | |

---

## Worksheet 6-1: Q5

Let $S = \{(1,1), (1,2), (2,1), (2,2)\}$.

1. Sketch $S$ and its convex hull $\text{conv}(S)$.

2. What is the maximum number of points from $S$ needed to represent any point in $\text{conv}(S)$ as a convex combination? (Hint: Carathéodory's theorem.)

3. Write the point $\mathbf{x} = (1.5, 1.4)$ as a convex combination of points in $S$.
