5. An air conditioning unit is controlled by four variables: temperature \( T \), humidity \( \mathrm{H} \), the time of the day \( \mathrm{D} \), and the day of the week \( \mathrm{W} \). The unit is turned on under any of the following circumstances.
i) The temperature exceeds \( 78^{\circ} \mathrm{F} \), and the time of the day is between 8 am and \( 5 \mathrm{pm} \).
ii) The humidity exceeds \( 85 \% \). The temperature exceeds \( 78^{\circ} \mathrm{F} \), and it is a weekend.
iii) The humidity exceeds \( 85 \% \). The temperature exceeds \( 78^{\circ} \mathrm{F} \), and the time of the day is between 8 am and \( 5 \mathrm{pm} \).
iv) It is Saturday or Sunday and the humidity exceeds \( 85 \% \),
Write the logic expression(s) for controlling the unit and draw the optimal logic circuit for it.