<p>I will leave the clarity of the question aside. </p>

<p>1) If what is meant by perfect substitutes/complements do not imply that these products are necessarily relevant for the preferences of an agent, then the answer is positive, with the utility function $U(x,y,z)$ being defined as 
$$
U(x,y,z)=0 \text{ for all } x,y, \text{ and }z.
$$
2) If it is implicitly understood that increasing $x$ and $z$ together would yield a higher utility and one for one transfer between $x$ and $y$ consumption yields the same utility for the agent, then the answer is negative. The reasoning can be seen as follows.
$$
\begin{eqnarray}
\mathbf{U(1,2,0)}&amp;=&amp;U(0,2,0) \text{ by perfect complementarity}\\
&amp;&lt;&amp;U(1,2,1) \text{ since $x$ and $z$ consumption together is good}\\
&amp;=&amp;U(0,3,1) \text{ since $x$ and $y$ are perfect substitutes}\\
&amp;=&amp;U(0,3,0) \text{ due to perfect complementarity between $x$ and $z$}\\
&amp;=&amp;\mathbf{U(1,2,0)} \text{ since $x$ and $y$ are perfect substitutes}\\
\end{eqnarray}
$$
leading to a contradiction. A general proof can be written when the assumptions are relaxed, but I believe this is sufficiently clarifying.</p>

CC BY-SA 3.0
2015-10-17T04:02:35.323Z
Ah! So that's what the nuance behind the question's conditions. This is very good.
Kitsune Cavalry
CC BY-SA 3.0
2015-10-17T03:00:29.053Z
2015-10-17T03:00:29.053Z
ramazan
<p>If you are just asking for a utility function, then as BB King has noted, $U(x,y,z) = \min\left\{x+y, z\right\}$ works for perfect complements. If you are working with just complements in general, then you can put a weight on the goods to show their complementariness.</p>

<p>$$U(x,y,z) = \min \left\{\alpha(x + y), (1-\alpha)z \right\}$$</p>

<p>Remember though that the price of x and y may determine whether you actually buy x or y. If $p_x &gt; p_y$, then the consumer will not purchase any of good $x$, and similarly for $p_y &gt; p_x$.</p>

CC BY-SA 3.0
2015-10-16T20:10:34.400Z
2015-10-16T20:10:34.400Z
Kitsune Cavalry
<p>Given
1) Perfect substitutes: X and Y
2) Compliments: Z and X
is it possible to generate a utility function that relates them?</p>

<p>X and Z must always be consumed together, and you can substitute Y for X.</p>

CC BY-SA 3.0
2015-10-16T09:02:31.850Z
Do you need perfect compliments? If so try U=min{x+y, z}. If you need just some degree of complimentaritt then try      u=(x+y)*z
BB King
CC BY-SA 3.0
2015-10-17T07:27:50.663Z
Can Y be used instead of X as a complement for Z (e.g. X and Y are butter and margarine and Z is bread)? If the answer is yes then BB King's function will do the job. If not then ramzan's answer it the one you are looking for (but I can't think of a good practical example of this case).
Ubiquitous
<macroeconomics>
Combining Compliment and Substitue Goods
Kate
# Combining Compliment and Substitue Goods

(Asked by: username_0 on 2015-10-16)

Given
1) Perfect substitutes: X and Y
2) Compliments: Z and X
is it possible to generate a utility function that relates them?

X and Z must always be consumed together, and you can substitute Y for X.

**Tags:** macroeconomics
> **Comments:**
> **username_1**: Do you need perfect compliments? If so try U=min{x+y, z}. If you need just some degree of complimentaritt then try      u=(x+y)*z  
> **username_2**: Can Y be used instead of X as a complement for Z (e.g. X and Y are butter and margarine and Z is bread)? If the answer is yes then BB King's function will do the job. If not then ramzan's answer it the one you are looking for (but I can't think of a good practical example of this case).  

---

## 2 answers

### Answer by username_3 on 2015-10-17. Score: 2

I will leave the clarity of the question aside.

1) If what is meant by perfect substitutes/complements do not imply that these products are necessarily relevant for the preferences of an agent, then the answer is positive, with the utility function $U(x,y,z)$ being defined as
$$
U(x,y,z)=0 \text{ for all } x,y, \text{ and }z.
$$
2) If it is implicitly understood that increasing $x$ and $z$ together would yield a higher utility and one for one transfer between $x$ and $y$ consumption yields the same utility for the agent, then the answer is negative. The reasoning can be seen as follows.
$$
\begin{eqnarray}
\mathbf{U(1,2,0)}&=&U(0,2,0) \text{ by perfect complementarity}\\
&<&U(1,2,1) \text{ since $x$ and $z$ consumption together is good}\\
&=&U(0,3,1) \text{ since $x$ and $y$ are perfect substitutes}\\
&=&U(0,3,0) \text{ due to perfect complementarity between $x$ and $z$}\\
&=&\mathbf{U(1,2,0)} \text{ since $x$ and $y$ are perfect substitutes}\\
\end{eqnarray}
$$
leading to a contradiction. A general proof can be written when the assumptions are relaxed, but I believe this is sufficiently clarifying.

> **Comments:**
> **username_4**: Ah! So that's what the nuance behind the question's conditions. This is very good.  

---

### Answer by username_4 on 2015-10-16. Score: 1

If you are just asking for a utility function, then as BB King has noted, $U(x,y,z) = \min\left\{x+y, z\right\}$ works for perfect complements. If you are working with just complements in general, then you can put a weight on the goods to show their complementariness.

$$U(x,y,z) = \min \left\{\alpha(x + y), (1-\alpha)z \right\}$$

Remember though that the price of x and y may determine whether you actually buy x or y. If $p\_x > p\_y$, then the consumer will not purchase any of good $x$, and similarly for $p\_y > p\_x$.


---

