[Economics] Demand for minimum of $4$ different goods
Solution 1:
You can solve it sequentially by noting the nesting structure of the utility function $U$.
So first note that the utility function combines utility functions you are probably already familiar with $U=\min\{u_1,u_2\}$ of complements and $u_1=\sqrt{x+y}$ and $u_2 = z+w$ both of which are perfect substitutes. Where $u_1$ and $u_2$ are nested within $U$.
The solution procedure is based on the following argument: However much money $m_{u_1}$ the agent decides to spend on $u_1 =\sqrt{x+y}$ she must be minimizing the cost of getting $u_1$ utility points. Similarly, however much money $m_{u_2}$ the agent spends on $u_2= z + w$ it must be the case that the agent minimize cost. So first find the expenditure functions for these inner problem.
Secondly the agent must the maximize the outer utility $\min\{u_1,u_2\}$ subject to the expenditures of the inner problems adding up to total income.
Solve the second inner problem:
The second inner problem is $$max_{z,w} \{z+w \lvert p_zz+p_ww\leq m_{u_2}\},$$
where $m_{u_2}$ is money spend on $u_2$.
How do you get the most utility for the buck when utility is $u_2 = z + w$? You simply buy the cheapest good so the price of one point of $u_2$ utility is $p_{u_2} := \min\{p_z,p_w\}$. The demand for $z$ and $w$ depends on the amount of money you decide to spend on $u_2$ assumed for now to be $m_{u_2}$. Given this amount demand for $z$ is
$$z = \frac{m_{u_2}}{p_z} 1[p_z <p_w]$$
and
$$w = \frac{m_{u_2}}{p_w} 1[p_w <p_z].$$
I leave it to you to handle the threshold case where $p_z=p_w$. How much utility $u_2$ do you get? Well this must be $u_2 = m_{u_2}/\min\{p_z,p_w\}$ - this is the value function for this inner utility maximization problem - hence it must be the case that
$$m_{u_2} = \min\{p_z,p_w\} u_2,$$
which is the expenditure function for this inner problem.
Solve the first inner problem:
The first inner problem is $$max_{x,y} \{\sqrt{x+y} \lvert p_xx+p_yy\leq m_{u_1}\},$$
where $m_{u_1}$ is money spend on $u_1$.
How do you get the most utility for the buck when utility is $u_1 = \sqrt{x+y}$? It is perfect substitutes so you buy the cheapest good so demand is
$$x = \frac{m_{u_1}}{p_x} 1[p_x <p_y]$$
and
$$y = \frac{m_{u_1}}{p_y} 1[p_y <p_x],$$
where $m_{u_1}$ is amount of money spend on $u_1$ assumed known. How much utility $u_1$ do you get? That must be $u_1 = \sqrt{m_{u_1}/\min\{p_x,p_y\}}$ such that
$$m_{u_1} = \min\{p_x,p_y\} u_1^2$$
Solve outer problem:
The outer problem is
$$\max_{u_1,u_2}: \ \ \ \min\{u_1,u_2\} \\[8pt] s.t. \ \ \ \ m_{u_1} + m_{u_2} = m $$
for which we rewrite the budget constraint to
$$\min\{p_x,p_y\} u_1^2 + \min\{p_z,p_w\} u_2 = m$$
and then use that $u_1=u_2$ because the problem is perfect complements. You then have two equations in two unknowns $u_1$ and $u_2$. Solve for $u_1$ and $u_2$ and plug solutions back into expenditure functions for inner problems to get $m_{u_1}$ and $m_{u_2}$ which you then plug into the equations for the demand.
Solution 2:
To provide another answer with less equations:
Consider first that the inner utility function $u_1 = \sqrt{x+y}$ and $u_2 = z + w$ are perfect substitutes implying that consumer only buy the cheapest of $x$ and $y$ and similarly only the cheapest of $z$ and $w$. Because prices are given we know that $y$ is cheaper than $x$ and $w$ is cheaper than $z$. Using this we can simply set $x=0$ and $z=0$ and get the utility maximization problem
Maximize $$U(y,w) = \min\{\sqrt y,w\}$$
which implies that $\sqrt y = w$ for any solution.
Therefore there are two equations in two unknowns
$$p_y y + p_w w = m \Rightarrow 2y + w = 1$$
and $$\sqrt y = w$$
Hence it follows that
$$2y + \sqrt y = 1$$
which is satisfied for $y=1/4$ and since $\sqrt y = w$ it follows that $w = \sqrt(1/4) = 1/2$. Adding that $x=0$ and $z=0$ we have all demands.