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

Homework Help: A quick question, pls help

  1. Apr 28, 2010 #1
    Anyone can give me a example of a bijective fuction from N to N^2?
  2. jcsd
  3. Apr 29, 2010 #2


    User Avatar
    Science Advisor

    I can't give you a simple "formula" but here is how to get a bijective function:

    Write the numbers 1, 2, 3, ... horizontally and to left of "1" and slightly below write 1, 2, 3, ... vertically so that the cell below "m" and to the right of "n" is the pair (m,n). Now start at (1, 1) and "zigzag" through that array. That is, go from (1,1) horizontally to (2, 1) then diagonally, down and left, to (1,2), down to (1, 3), diagonally up and right to (2,3) and (3, 1), right to (4, 1), diagonally down to (3,2), etc.
  4. Apr 30, 2010 #3
    Or for a simple formula try [itex](m,n)\rightarrow 2^m(2n+1)-1[/itex].
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook