# Can anyone see a relationship here?

#### eNathan

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 Any help?
--Thanks!

2^(j-1)= X

#### eNathan

wow....what is the highest class you have taken in mathematics?

#### Gale

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...

#### Hurkyl

Staff Emeritus
Gold Member
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!)

#### Gale

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.

#### eNathan

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 belive that, but why exactly? Can you explain a senario(s) 2^x comes in handy?

Math ownage :D

#### Gale

eNathan said:
Well I can belive 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.

#### Curious3141

Homework Helper
eNathan said:
Well I can belive 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 .

Last edited:

#### BicycleTree

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).

#### whozum

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.

#### Curious3141

Homework Helper
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.

#### TenaliRaman

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

#### Crosson

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.

#### Curious3141

Homework Helper
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.

#### Pengwuino

Gold Member
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 dont have a full packet or sector or whatever.

#### whozum

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 dont 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.

#### master_coda

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 dont 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.

#### chris_1124

How is this

{2^n + 1 , 2^(n+1)} n belongs N

#### BicycleTree

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.
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:

### Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving