Can you charge two devices with only one power socket

convex-geometryinequalityrecreational-mathematics

I am sitting in a library with a laptop and a phone, and only one power socket. I wondered if eventually one of the devices will necessarily run out of power. By doing some math I figured out an answer to this question, but I feel like there should be a simpler explanation for it.

Call $a_1$ the charge speed of device $1$, $b_1$ its energy consumption speed, and similarly $a_2, b_2$ for device $2$. Assume $a_i \geq b_i$. Charging a device corresponds to translating the battery level $(x_1, x_2)^T$ by a positive multiple of one of the charging vectors
$$c_1 = \begin{pmatrix} a_1 – b_1 \\ – b_2 \end{pmatrix}, \qquad c_2 = \begin{pmatrix} – b_1 \\ a_2 – b_2 \end{pmatrix}$$

Mathematically, the question is under what condition the positive cone spanned by these vectors contains a vector $(x_1, x_2)^T$ with $x_1, x_2 \geq 0$. This guarantees that none of the devices will run out of battery. If in addition $x_1, x_2 > 0$, I can assure they will be both fully charged over time.

                                 Positive cone spanned by c1 and c2

With the angles $\theta_1, \theta_2$ defined as in the image, the question is equivalent to $\theta_1 + \theta_2 \leq \frac \pi 2$, or also $\cos(\theta_1 + \theta_2) \geq 0$. By using the sum formula for $\cos$ and computing some inner products, this gives an inequality in the $a_i$ and $b_i$, which simplifies tremendously to
$$\left( \frac{a_1}{b_1} – 1 \right) \left(\frac{a_2}{b_2} – 1 \right) \geq 1 \,.$$
Note that both factors in the left hand side are nonnegative, because $a_i \geq b_i$.

Is there a more intuitive explanation why this simple inequality is the answer? What happens if I bring a third device to the library?

Best Answer

Others have addressed the electrical issues, I'm just commenting on the geometry. The question is, for $a_1$, $a_2$, $b_1$, $b_2$ positive, why is it true that the positive quadrant is in the positive span of $\begin{bmatrix} a_1 - b_1 \\ -b_2 \end{bmatrix}$, $\begin{bmatrix} - b_1 \\ a_2-b_2 \end{bmatrix}$ if and only if $(a_1/b_1 - 1) (a_2/b_2 - 1) \geq 1$.

Looking at the picture you have drawn, and assuming the vectors lie in the orthants shown, the positive quadrant is in the positive span of these vectors if and only if the angle from $\vec{c}_1$ to $\vec{c}_2$ is counterclockwise. You can compute this by computing the sign of the determinant $$\det \begin{bmatrix} a_1 - b_1 & -b_1 \\ -b_2 & a_2 - b_2 \\ \end{bmatrix} = (a_1 - b_1)(a_2 - b_2) - b_1 b_2.$$ So you can charge your laptop if $$(a_1 - b_1)(a_2 - b_2) - b_1 b_2 \geq 0,$$ which is equivalent to your condition.

Related Question