phaze Posted September 24, 2010 Report Share Posted September 24, 2010 While in university (Computer Science) the lecturer put up a slide with the value of 2^32 on it One of the more outspoken members of the class quickly fiddled with there calculator and stated that the value was wrong. They claimed that it was out by one. I took a quick look at the board and stated that the one on the board was correct How did I know? Could I have been wrong? If so what should have I said? Quote Link to comment Share on other sites More sharing options...
0 HoustonHokie Posted September 24, 2010 Report Share Posted September 24, 2010 I'm guessing that you noticed that the value written on the board was even. If so, there's no way the answer could be out by one. It could have been out by 2, 4, 6, etc. but could not have been out by 1. Since you were in computer science class, the value of 2^32 was probably written in binary instead of decimal. So with your quick glance you counted the number of 0s written on the board. Confirming that there were, in fact, 32 0s, you knew that the correct representation 2^32 was on the board. Quote Link to comment Share on other sites More sharing options...
0 EventHorizon Posted September 24, 2010 Report Share Posted September 24, 2010 First, did you mean off by 1 factor of 2, or off by the value 1? If it was off by the value 1, it would be an odd number, so obviously couldn't have been 2^32. He probably was thinking of the largest number representable by an unsigned 4-byte integer (off by 1 due to 0 based). If it was off by a factor of 2, 2^30 starts with 1 (1024^3), so multiplying by 4 (=2^2) results in 2^32 starting with 4. And it would be in the billions = 10 digit number. You could also make sure the last digit was the right one using modular arithmetic. 2^1 = 2 2^2 = 4 2^3 = 8 2^4 = 16 2^5 = 32 2^6 = 64 etc. Notice that the last digit cycles through 2,4,8,6,2,4,8,6,etc. So if you mod by 4 you'll see it should end in 6. Yes, you could have been wrong, but the number probably looked right. Quote Link to comment Share on other sites More sharing options...
0 Guest Posted September 24, 2010 Report Share Posted September 24, 2010 While in university (Computer Science) the lecturer put up a slide with the value of 2^32 on it One of the more outspoken members of the class quickly fiddled with there calculator and stated that the value was wrong. They claimed that it was out by one. I took a quick look at the board and stated that the one on the board was correct How did I know? Could I have been wrong? If so what should have I said? The number will obviously be even, so if I take you literally,the one's digit would be even according to one of you (presumably yourself) and odd per the other. Every computer science student knows that 2^10 = 1024, 2^20 = 1024^2, 2^30 = 1024^3; so 2^32 must end in 4^3 x 4 = 4^4 mod 10, or 2^8 mod 10, or 256 mod 10, which is 6. Quote Link to comment Share on other sites More sharing options...
0 phaze Posted September 24, 2010 Author Report Share Posted September 24, 2010 (edited) What really happened was How did I know? The one on the board was divisible by 2 Could I have been wrong? Yes, both answers could have been wrong If so what should have I said? Depends, Probably best to be diplomatic and say the one on the board was correct rather than being technically accurate by saying the one on the calculator is wrong Never trust a cheap calculator over common sense Edited September 24, 2010 by phaze Quote Link to comment Share on other sites More sharing options...
0 Guest Posted September 24, 2010 Report Share Posted September 24, 2010 The number will obviously be even . Every computer science student knows that 2^10 = 1024, 2^20 = 1024^2, 2^30 = 1024^3; so 2^32 must end in 4^3 x 4 = 4^4 mod 10, or 2^8 mod 10, or 256 mod 10, which is 6. Quote Link to comment Share on other sites More sharing options...
0 Guest Posted September 24, 2010 Report Share Posted September 24, 2010 The only response the classmember could have provided that would be "off" the posted answer "by one" would reveal an odd number (if the posted answer was truly correct). As multiples of two, all powers of two greater than 2<0 would be even. Quote Link to comment Share on other sites More sharing options...
0 Guest Posted September 24, 2010 Report Share Posted September 24, 2010 off by one= odd Quote Link to comment Share on other sites More sharing options...
Question
phaze
While in university (Computer Science) the lecturer put up a slide with the value of 2^32 on it
One of the more outspoken members of the class quickly fiddled with there calculator and stated
that the value was wrong. They claimed that it was out by one.
I took a quick look at the board and stated that the one on the board was correct
How did I know?
Link to comment
Share on other sites
7 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.