Log in

View Full Version : Dumb question...


xnaut
19-03-2009, 17:01
Does anyone know the actual comparative weight of lines of code?
yes i mean the weight of the little electrons and such

i heard someone else say in another thread --

Each space = ~0.0001327 oz.


:p

Is this accurate?... it seems like a bunch over what it should be... just wondering...

tim_reiher
19-03-2009, 17:09
Were you guys really that desperate on weight this year? :rolleyes:


If so, when in doubt, more 0's and fewer 1's. :P

xnaut
19-03-2009, 17:12
Were you guys really that desperate on weight this year? :rolleyes:


If so, when in doubt, more 0's and fewer 1's. :P


lol... ya thats a good idea

our weight wasn't an issue this year, i was just curious and bored

martin417
19-03-2009, 18:34
Discover magazine did an article several years ago, called "How much does the internet weigh?". In the article, they assumed that a zero weighed nothing, and a one weighed however many electrons it took to store that value on a mempry chip. If I remember correctly, all the data on the internet weighed way less than one billionth of an ounce.

OH look, here's the article! (http://discovermagazine.com/2007/jun/how-much-does-the-internet-weigh)

Forgive any misrepresentations, I didn't re-read the article, and I may have mis-remembered the facts.

RyanCahoon
19-03-2009, 18:45
Perhaps getting a bit more technical than is necessary, it's interesting to note that spaces themselves have no effect on 'weight' in compiled code. Whitespace characters [spaces, tabs, newlines (except in certain circumstances/languages)], along with comments, are thrown away by the Lexer, the part of the compiler that is responsible for taking the source code and turning it into a sequence of tokens, which is basically each word or symbol that appears in the source file. (Unless of course you're actually programming in White Space (http://en.wikipedia.org/wiki/Whitespace_(programming_language))) Extra lines of code, however, may (in most cases yes, but they may actually get optimized away by the compiler) add 'weight' to the final compiled program. In order to control what may be written as 0s or 1s, however, you'll have to go to a lower level, in assembly code.

But seeing as each electron is 9.109 E−31 kg, you'd probably get more benefit with one pass of a metal file somewhere discrete. :rolleyes:

--Ryan

ay2b
19-03-2009, 19:32
If so, when in doubt, more 0's and fewer 1's. :P

Ah, but which actually weighs more, a 1 or a 0? If you go with historical precedence (i.e. back to the punchcard days), I believe a "0" was unpunched and a "1" was punched, which means that a 0 weighs more than a 1.

tim_reiher
19-03-2009, 20:25
Ah, but which actually weighs more, a 1 or a 0? If you go with historical precedence (i.e. back to the punchcard days), I believe a "0" was unpunched and a "1" was punched, which means that a 0 weighs more than a 1.

Hmm... interesting point...

I think if we had to have computers requiring punch cards on our robots, we might have bigger weight issues to worry about, though. :rolleyes:

GaryVoshol
19-03-2009, 20:31
Zeros must weigh more - they're fatter.

(Hey, I resemble that shape) :p

Creator Mat
19-03-2009, 23:13
so hypothetically speaking what would you do if your robot was so close to weight and everything physical was done away with until it was just structurally stable. And the weight of your code mattered:eek:.

Jibs
19-03-2009, 23:20
Actually I believe 1s are heavier since a one represents a charged capacitor.

*read the article that was linked above* I'm not THAT geeky :p

so hypothetically speaking what would you do if your robot was so close to weight and everything physical was done away with until it was just structurally stable. And the weight of your code mattered:eek:.Just another thing we can blame programmers for :D

Doug G
20-03-2009, 00:07
Actually I believe 1s are heavier since a one represents a charged capacitor.

*read the article that was linked above* I'm not THAT geeky :p

Just another thing we can blame programmers for :D

I can't help myself.... A CHARGED CAP WEIGHS THE SAME AS A DISCHARGED CAP!! I've heard the same logic used incorrectly to explain that a dead battery weighs less than a fresh battery. CAP's store PE by separating charge, not storing one type of charge!! Ok, I'll leave it alone and not return... the teacher has left the room.

Nate Laverdure
20-03-2009, 00:23
Discover magazine did an article several years ago, called "How much does the internet weigh?". In the article, they assumed that a zero weighed nothing, and a one weighed however many electrons it took to store that value on a mempry chip. If I remember correctly, all the data on the internet weighed way less than one billionth of an ounce.

OH look, here's the article! (http://discovermagazine.com/2007/jun/how-much-does-the-internet-weigh)

Forgive any misrepresentations, I didn't re-read the article, and I may have mis-remembered the facts.
I remember enjoying that article immensely when I first read it. If you follow the figures published there, you'll find that data weighs 6.4 * 10^-31 oz per kilobyte. This means you'll need about 1.5 * 10^21 terabytes of 1s and 0s to have an ounce of data. Interestingly, this article (http://adamant.typepad.com/seitz/2007/04/weighing_the_we.html) provides further figures and even suggests that the entire internet weighs about two ounces.

Now, if you consider that the entire universe is made of math (http://discovermagazine.com/2008/jul/16-is-the-universe-actually-made-of-math/article_view?b_start:int=0&-C=), then you can imagine how much data we're all messing with every day.

RyanCahoon
20-03-2009, 00:28
I can't help myself.... A CHARGED CAP WEIGHS THE SAME AS A DISCHARGED CAP!! I've heard the same logic used incorrectly to explain that a dead battery weighs less than a fresh battery. CAP's store PE by separating charge, not storing one type of charge!! Ok, I'll leave it alone and not return... the teacher has left the room.

But what happens if it's not actually a capacitor, but a piece of NAND Flash memory using quantum tunnel injection (http://en.wikipedia.org/wiki/Tunnel_injection)? :cool:

Actually I have no idea what the answer is.

Here's an interesting concept however: If you pick up enough static from the regolith, can you get enough weight in extra electrons to give you a significant advantage over the competition? That all assumes you're not actually losing electrons to the floor instead...

--Ryan

Uberbots
20-03-2009, 09:19
But what happens if it's not actually a capacitor, but a piece of NAND Flash memory using quantum tunnel injection (http://en.wikipedia.org/wiki/Tunnel_injection)? :cool:

Actually I have no idea what the answer is.

Here's an interesting concept however: If you pick up enough static from the regolith, can you get enough weight in extra electrons to give you a significant advantage over the competition? That all assumes you're not actually losing electrons to the floor instead...

--Ryan

If you lose that much weight in electrons, you had better be prepared for one heluva static shock when you pick up the robot again.

xnaut
20-03-2009, 18:46
wow... i never expected this thread to pick up... but then again here it goes... first teams suprise me everyday...

Cow Bell Solo
22-03-2009, 02:59
I calculated the weight of our code which ended up being 2.4164*10 ^ -18 pound according to the above article. And yes I had to do it.

McGurky
22-03-2009, 10:53
What they should take into account is the weight of all of the storage devices for all of that data!!! Hard drives and such!!!! we might come up with a tiny bit of a bigger number!!!!:rolleyes:

clueless newbie
22-03-2009, 18:18
Ah, but which actually weighs more, a 1 or a 0? If you go with historical precedence (i.e. back to the punchcard days), I believe a "0" was unpunched and a "1" was punched, which means that a 0 weighs more than a 1.

Both were punched. 12(very top), 11, 0 .. 9 (very bottom). If 0 wasn't punched you couldn't distinguish between a composite that used 0 and one that did not.

Believe me --- on this I'm not

clueless

http://www.columbia.edu/acis/history/026-card-700.jpg

Koko Ed
22-03-2009, 18:27
Check it out. I've hit virtual wonderland.
A very happy unbirthday to you all.
I'm going to open some bills now and get back in touch with reality now....

Nate Laverdure
22-03-2009, 19:40
Ah, but which actually weighs more, a 1 or a 0? If you go with historical precedence (i.e. back to the punchcard days), I believe a "0" was unpunched and a "1" was punched, which means that a 0 weighs more than a 1.
Both were punched. 12(very top), 11, 0 .. 9 (very bottom). If 0 wasn't punched you couldn't distinguish between a composite that used 0 and one that did not.
The lightest possible dataset being the lace card (http://en.wikipedia.org/wiki/Lace_card):

http://upload.wikimedia.org/wikipedia/commons/7/7d/IBM_lace_card.jpg (http://en.wikipedia.org/wiki/File:IBM_lace_card.jpg)

clueless newbie
22-03-2009, 19:51
The lightest possible dataset being the lace card (http://en.wikipedia.org/wiki/Lace_card):

http://upload.wikimedia.org/wikipedia/commons/7/7d/IBM_lace_card.jpg (http://en.wikipedia.org/wiki/File:IBM_lace_card.jpg)

True, but there's no valid data on a laced card. If the read station was mechanical (rather than optical) chances are that laced card would jam the reader.