Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Can anyone see a relationship here?

  1. Jun 12, 2005 #1
    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?
  2. jcsd
  3. Jun 12, 2005 #2
    2^(j-1)= X
  4. Jun 12, 2005 #3
    wow....what is the highest class you have taken in mathematics?
  5. Jun 12, 2005 #4
    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...
  6. Jun 12, 2005 #5


    User Avatar
    Staff Emeritus
    Science Advisor
    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!)
  7. Jun 12, 2005 #6
    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.
  8. Jun 12, 2005 #7
    Well I can belive that, but why exactly? Can you explain a senario(s) 2^x comes in handy?

    Math ownage :D
  9. Jun 12, 2005 #8
    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.
  10. Jun 12, 2005 #9


    User Avatar
    Homework Helper

    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: Jun 13, 2005
  11. Jun 12, 2005 #10
    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).
  12. Jun 12, 2005 #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.
  13. Jun 13, 2005 #12


    User Avatar
    Homework Helper

    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.
  14. Jun 13, 2005 #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
  15. Jun 13, 2005 #14
    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.
  16. Jun 13, 2005 #15


    User Avatar
    Homework Helper

    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.
  17. Jun 13, 2005 #16


    User Avatar
    Gold Member

    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.
  18. Jun 13, 2005 #17
    Some of the space is saved up for boot sectors and partition tables etc. Its a very minora mount of space.
  19. Jun 14, 2005 #18
    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.
  20. Jun 14, 2005 #19
    How is this

    {2^n + 1 , 2^(n+1)} n belongs N
  21. Jun 14, 2005 #20
    I had read something about this earlier. For special cases, including data transfer rates, "kilo" really does mean 1000. See "usage notes" here:
    Last edited: Jun 14, 2005
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook