All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Temperature Reflection (Posted on 2003-09-29)
On my way to work, I pass by a digital thermometer outside a bank that displays the temperature to the nearest integer, alternating back and forth between Fahrenheit and Celsius at four-second intervals.

The other day, when I was going to work, I noticed that the temperatures displayed in Fahrenheit and Celsius were simply reverse digits of each other.

Well, it warmed up nicely during the day, and when I was on my way home, I looked at the same thermometer.
Imagine my shock when, again, the Fahrenheit and Celsius temperature displays were simply reversed digits of each other!

What was the temperature when I came in to work, and what was it when I was on my way home?

Note: To convert from degrees Fahrenheit to Celsius, subtract 32 then multiply by 5/9. To convert the other way, simply do the opposite (multiply by 9/5 and add 32). Ignore leading zeroes.

 Submitted by DJ Rating: 4.2308 (13 votes) Solution: (Hide) 61°F, 16°C 82°F, 28°C First, the problem states that both temperatures have 2 digits. A 2-digit number can be represented as 10x+y, where x is the first digit and y is the second. Reversing these digits, simply enough, gives 10y+x. In this problem, the number is reversed when converted from Fahrenheit to Celsius, or vice versa. That gives us one of two equivalent equations: (10x+y - 32)(5/9) = 10y+x or (10x+y)(9/5) + 32 = 10y+x. The first one, with some algrebraic manipulation, becomes: 50x + 5y - 160 = 90y + 9x 41x = 85y + 160 x=(85y+160)/41 The second equation evaluates the same way, with x and y reversed. At this point, we can simply plug in each digit for y to find the values for x that are nearest to an integer (so that when the actual temperature is evaluated, it rounds correctly). ```y x 0 3.9024... 1 5.97560... 2 8.04878... 3 10.12195... ``` Since x must be a single digit, y can be only 0, 1, or 2 (for higher numbers x is greater than 10), and there are only three possibilities: ```y=0, x=4: 40°F and 4°C y=1, x=6: 61°F and 16°C y=2, x=8: 82°F and 28°C ``` However, since both temperatures should have two digits when written both ways, 40 and 4 is eliminated (we are told to ignore leading zeroes). Thus, it was 61°F (16°C) when I went to work, and 82°F (28°C) when I came home. I also wrote the following small javascript to find the solutions: ```for (var f=0; f<100; f++) { x=Math.floor(f/10); y=f%10; c=Math.round((f-32)*5/9); c2=10*y+x; if (c==c2) document.write(f + ", " + c + "
"); } ``` This outputs: ```40, 4 61, 16 82, 28 ``` But again, we throw out the solution containing just 4.

 Subject Author Date Javascript Dej Mar 2006-02-26 22:26:08 MS Excel solution john 2005-06-08 19:22:38 re(3): computer solution abc 2003-09-30 14:07:39 re(2): computer solution Charlie 2003-09-29 20:13:17 short solution Tristan 2003-09-29 18:24:23 re: computer solution abc 2003-09-29 15:14:59 computer solution Charlie 2003-09-29 11:00:07 proof abc 2003-09-29 10:36:22 Solution Riaan 2003-09-29 09:04:36 Solution nikki 2003-09-29 08:55:21

 Search: Search body:
Forums (7)
Random Problem
Site Statistics
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox: