Can anyone see a relationship here?

  • Thread starter Thread starter eNathan
  • Start date Start date
  • Tags Tags
    Relationship
AI Thread Summary
The discussion centers around finding a relationship between two variables in a Delphi application, specifically identifying that X equals 2 raised to the power of (j-1). Participants emphasize the importance of understanding powers of 2 in programming and mathematics, citing practical applications in computing, such as binary data representation and memory sizes. There is a debate about the use of powers of 2 in contexts like data transfer rates and radioactive decay, highlighting the confusion between binary and decimal interpretations. The conversation also touches on the marketing of hard drive capacities, where manufacturers use decimal values for storage while computers interpret them in binary. Overall, the thread underscores the relevance of powers of 2 in various mathematical and practical scenarios.
eNathan
Messages
351
Reaction score
2
I am trying to delvelop a Delphi application and it would greatly simplify my code if I can find the relationship between these two vars.

J X
____
1 1
2 2
3 4
4 8
5 16

I treid several things, but they seem to be inconsistent :cry: Any help?
--Thanks!
 
Mathematics news on Phys.org
2^(j-1)= X
 
wow...what is the highest class you have taken in mathematics?
 
heh, well, I'm a math major, and i just wrapped up diff eq and linear alg last semester... But that was a pretty easy problem really... heh. i thought it was a joke or that i was missing something...
 
Powers of 2 are your friend, especially if you're into programming. It's good to memorize the first few. (Up to 2^8, at the very least!)
 
Hurkyl said:
Powers of 2 are your friend, especially if you're into programming. It's good to memorize the first few. (Up to 2^8, at the very least!)

agreed entirely. when i tutor even younger kids. i always review times tables and powers of two up through 2^8, plus the first few powers of three, four and five.
 
Powers of 2 are your friend, especially if you're into programming. It's good to memorize the first few. (Up to 2^8, at the very least!)

Well I can believe that, but why exactly? Can you explain a senario(s) 2^x comes in handy?

Math ownage :D
 
eNathan said:
Well I can believe that, but why exactly? Can you explain a senario(s) 2^x comes in handy?

Math ownage :D

well, your problem is a pretty fair example. plus if you want to know binary, it helps to know your powers of two. the reason i always have my students do it though is factoring.
 
eNathan said:
Well I can believe that, but why exactly? Can you explain a senario(s) 2^x comes in handy?

Math ownage :D

Many applications to knowing the powers of 2. Computers are binary based, so you find powers of 2 everywhere, e.g. "64 KB" of RAM is not really 64 * 10^3 bytes, rather it's 2^16 = 65,536 bytes of RAM. And a cable modem speed of 512 kb/sec is really 524,288 bits/sec. And that 24 bit "true color" depth of your monitor really means exactly 2^24, or approx 16.7 million colors. And so forth.

Also helps in radioactive decay problems, e.g. you can "instantly see" that after 10 half lives, the activity of a sample would have decremented to exactly 2^(-10) = 1/1024, or approx 0.1 %, of the initial activity.

There are many other examples as you go along. It's also a cool thing to know.

Personally, I know up to 2^20 by heart, then I have a little trouble with the higher powers . :wink:
 
Last edited:
  • #10
And a cable modem speed of 512 kb/sec is really 524,288 bits/sec
Aren't data transfer rates based on the decimal system? Why would cable modems be different?

I know powers of 2 up to 2^10 and also 2^15 (because of a 2-byte int).
 
  • #11
Gale punked me with this one.

Transfer rates are based on the bit/byte comparison.

1 byte = 8 bits

1 kilobyte = 1024 bytes

That rounding is where the discrepancy builds from. It is usually taken as 1000 bytes.
 
  • #12
BicycleTree said:
Aren't data transfer rates based on the decimal system? Why would cable modems be different ?

I'm not certain, but I thought they were based on powers of 2. I could be wrong, it's just something I always thought true.
 
  • #13
Calculating n^m in a machine is nearly O(m) for a naive solution however if you know the powers of 2, there is a neat efficient way. Ofcourse i am not going to give it away right now :p

-- AI
 
  • #14
the activity of a sample would have decremented to exactly 2^(-10) = 1/1024, or approx 0.1 %, of the initial activity.

Nice try, but this only an approximate (but neat) method. Half-Life does not involve powers of 2, it involves powers of e = 2.718... because it is a continuous decay.
 
  • #15
Crosson said:
Nice try, but this only an approximate (but neat) method. Half-Life does not involve powers of 2, it involves powers of e = 2.718... because it is a continuous decay.

You are wrong. Radioactive decay is an exponential process, but it is completely irrelevant which base is being used to model the decay. The commonly used "convenient" bases are 2 (giving the half life) and e (giving the decay constant).

Both approaches are equally valid mathematically, and there is no reason why a half-life approach is only an "approximation" while the decay constant approach is any more valid.
 
  • #16
BicycleTree said:
Aren't data transfer rates based on the decimal system? Why would cable modems be different?

No, all transfers and absolutely anything related to computers is done at the power of 2 number system because it represents the binary system. I think the confusion stems from the fact that we conveniently use "kilobyte" and "megabyte" and "gigabyte". We think of kilo and mega and immediately "1000" comes to our mind when in actuality, it should be 1024 (or 1024 * 1024 for megabyte). Thats where a lot of confusion comes in with hard drives. They'll create say, a 80 billion byte hard drive and say "Look at this 80 GB hard drive". It'll have exactly 80,000,000,000 bytes but when the computer reads it, it reads it in the base 2 system and when it displays a gigabyte number, it'll display 80,000,000,000 / (1024 * 1024) and it'll display around 74GB.

Oddly enough, I wonder why they do create hard drives of 80,000,000,000 bytes or other flat numbers like that. I thought everything was done in packets or sector or something like that and they had values of 32K and 64K and 128K etc etc. Sounds like towards the end, a few or maybe a lot of bytes are lost because they don't have a full packet or sector or whatever.
 
  • #17
Pengwuino said:
No, all transfers and absolutely anything related to computers is done at the power of 2 number system because it represents the binary system. I think the confusion stems from the fact that we conveniently use "kilobyte" and "megabyte" and "gigabyte". We think of kilo and mega and immediately "1000" comes to our mind when in actuality, it should be 1024 (or 1024 * 1024 for megabyte). Thats where a lot of confusion comes in with hard drives. They'll create say, a 80 billion byte hard drive and say "Look at this 80 GB hard drive". It'll have exactly 80,000,000,000 bytes but when the computer reads it, it reads it in the base 2 system and when it displays a gigabyte number, it'll display 80,000,000,000 / (1024 * 1024) and it'll display around 74GB.

Oddly enough, I wonder why they do create hard drives of 80,000,000,000 bytes or other flat numbers like that. I thought everything was done in packets or sector or something like that and they had values of 32K and 64K and 128K etc etc. Sounds like towards the end, a few or maybe a lot of bytes are lost because they don't have a full packet or sector or whatever.

Some of the space is saved up for boot sectors and partition tables etc. Its a very minora mount of space.
 
  • #18
Pengwuino said:
Oddly enough, I wonder why they do create hard drives of 80,000,000,000 bytes or other flat numbers like that. I thought everything was done in packets or sector or something like that and they had values of 32K and 64K and 128K etc etc. Sounds like towards the end, a few or maybe a lot of bytes are lost because they don't have a full packet or sector or whatever.

Because it's cheaper to make a drive with 80 * 1000^3 bytes of capacity than one with 80 * 1024^3 bytes of capacity. But you can still market it as 80GB by using the metric interpretation of GB instead of the interpretation used by everyone else in the computer industry.
 
  • #19
How is this

{2^n + 1 , 2^(n+1)} n belongs N
 
  • #20
Curious3141 said:
I'm not certain, but I thought they were based on powers of 2. I could be wrong, it's just something I always thought true.
I had read something about this earlier. For special cases, including data transfer rates, "kilo" really does mean 1000. See "usage notes" here:
http://en.wikipedia.org/wiki/Binary_prefix
Certain units are always understood as decimal even in computing contexts. For example, hertz (Hz), which is used to measure clock rates of electronic components, and bit/s, used to measure bitrate. So a 1 GHz processor performs 1,000,000,000 clock ticks per second, a 128 kbit/s MP3 stream consumes 128,000 bits (15.625 KiB) per second, and a 1 Mbit/s internet connection can transfer 1,000,000 bits (approx. 122 KiB) per second.
 
Last edited:
Back
Top