Editing 571: Can't Sleep

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 12: Line 12:
 
In this case, the least and greatest possible numbers are -32,768 and 32,767, which implies that the storage space used would be 16 bits. In addition, it's clear that the number is designated as a signed number, meaning that it can be either positive or negative.
 
In this case, the least and greatest possible numbers are -32,768 and 32,767, which implies that the storage space used would be 16 bits. In addition, it's clear that the number is designated as a signed number, meaning that it can be either positive or negative.
  
βˆ’
However, even if Cueball had this limitation, it would never actually pose a problem. By 32,767 sheep, at a rate of one sheep per second, Cueball has been counting for 9.101 hours (or about 9 hours 6 minutes). This would signify that he has extreme insomnia and probably needs treatment, and also that he has spent the entire night counting, and therefore would just get up and start the day rather than count sheep all over again from -32,768.
+
However, even if Cueball had this limitation, it would never actually pose a problem. By 32,767 sheep, at a rate of one sheep per second, Cueball has been counting for 9.101 hours (or about 9 hours 6 minutes). This would signify that he has extreme insomnia and probably needs treatment, and also that he has spent the entire night counting, and therefore would just get up and start the day rather than count sheep all over again from -32,768. Moreover, according to an experiment conducted by researchers at Oxford University, ''counting sheep is actually an inferior means of inducing sleep'' (see also the {{w|Counting sheep|Wikipedia article}}).
  
 
The title text refers to the 1968 Philip K. Dick science fiction novel ''{{w|Do Androids Dream of Electric Sheep?}}'', which was adapted into the perhaps more widely known Ridley Scott directed 1982 film ''Blade Runner''. The implication is that if we ever do create androids that dream of electric sheep, we should make sure to give them sufficient storage space to store numbers large enough such that an arithmetic overflow will be far less likely to occur, even if they count for a long time. A "long int" depends on machine architecture, but it typically consists of four bytes rather than two, so instead of being limited to a range from -32,768 to 32,767 the number will be capable of storing numbers from -2,147,483,648 to 2,147,483,647, which would take 68.1 years to exhaust (at the rate of 1 sheep/sec). "sheepCount" is a possible name for a variable to be used in a computer program. Declaring a variable tells the computer that it should allocate a portion of memory to be associated with the variable name given. No spaces are used because variables cannot contain spaces, for a reason that would take a little too long to properly explain here.
 
The title text refers to the 1968 Philip K. Dick science fiction novel ''{{w|Do Androids Dream of Electric Sheep?}}'', which was adapted into the perhaps more widely known Ridley Scott directed 1982 film ''Blade Runner''. The implication is that if we ever do create androids that dream of electric sheep, we should make sure to give them sufficient storage space to store numbers large enough such that an arithmetic overflow will be far less likely to occur, even if they count for a long time. A "long int" depends on machine architecture, but it typically consists of four bytes rather than two, so instead of being limited to a range from -32,768 to 32,767 the number will be capable of storing numbers from -2,147,483,648 to 2,147,483,647, which would take 68.1 years to exhaust (at the rate of 1 sheep/sec). "sheepCount" is a possible name for a variable to be used in a computer program. Declaring a variable tells the computer that it should allocate a portion of memory to be associated with the variable name given. No spaces are used because variables cannot contain spaces, for a reason that would take a little too long to properly explain here.

Please note that all contributions to explain xkcd may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see explain xkcd:Copyrights for details). Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel | Editing help (opens in new window)