## Can anyone see a relationship here?

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!
 Blog Entries: 5 2^(j-1)= X
 wow....what is the highest class you have taken in mathematics?

Blog Entries: 5

## Can anyone see a relationship here?

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...
 Recognitions: Gold Member Science Advisor Staff Emeritus 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!)

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

Math ownage :D

Blog Entries: 5
 Quote by eNathan 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.

Recognitions:
Homework Help
 Quote by eNathan 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 .

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

Recognitions:
Homework Help
 Quote by BicycleTree 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.
 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

 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.

Recognitions:
Homework Help
 Quote by Crosson 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.

Recognitions:
Gold Member
 Quote by BicycleTree 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.

 Quote by Pengwuino 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.