Discrete Mathematics Consider the following scenario from the central United Sta
ID: 3144632 • Letter: D
Question
Discrete Mathematics
Consider the following scenario from the central United States. You want to install an Air Conditioning unit in your apartment because in the summer it gets really hot. After a while of fumbling with it, finally you are done and the Unit is safely installed in place. Unfortunately, you bought an extra modern unit that needs to be programmed with logical statements.
You want the Unit run at full power when the thermostat senses a temperature of 75 degrees Fahrenheit or higher. When the thermostat senses a lower temperature, you want the Unit to turn off. Please formulate this set of rules using propositional logic. What kind of statement is used in programming languages for this type of rule?
Explanation / Answer
T_new = latest temperature \variable to record latest temperature
Update_temperature <- function (t)
{
\this function updates the latest temperature at time t \
T_new = temperature (t)
return(T_new)
}
For (Cooling unit is switched on)
{
T_new <- Update_temperature(t)
if (T_new >75)
{Cooling unit is run at full power}
if (T_new < 75)
{Cooling unit is off}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.