Results 1 to 3 of 3

Math Help - Ordeerd Pairs

  1. #1
    Newbie
    Joined
    Oct 2009
    Posts
    2

    Ordeerd Pairs

    for an Ordered Pair (m,n) I use the Encoding Method = ((m+n)(m+n+1)/2)+n for encoding this ordered pair into a single number, this helps me to find an enumeration for functions , so if I have a function that takes 2 arguments an an Input I encode them using this Mathmatical method , But my Question if I want to decode any number in an Ordered Pair , how to do this?

    I appreciate your help, I am a master of science in computer science student , and I attend the course of Computability theory.


    thanks for all

    Caio
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor

    Joined
    Aug 2008
    From
    Paris, France
    Posts
    1,174
    Quote Originally Posted by Fahed View Post
    for an Ordered Pair (m,n) I use the Encoding Method = ((m+n)(m+n+1)/2)+n for encoding this ordered pair into a single number, this helps me to find an enumeration for functions , so if I have a function that takes 2 arguments an an Input I encode them using this Mathmatical method , But my Question if I want to decode any number in an Ordered Pair , how to do this?
    My computations show that, if you are given the encoding Z, then, letting S=\left\lfloor \frac{\sqrt{8Z+1}-1}{2}\right\rfloor (integer part of (...)), you have n=Z-\frac{S(S+1)}{2} and you deduce m=S-n.

    A hint about the origin of my formula: the number inside the integer part is the positive solution to the equation \frac{x(x+1)}{2}=Z. And you must have \frac{S(S+1)}{2}\leq Z <\frac{(S+1)(S+2)}{2} (if you know where your formula comes from, this should be clear)
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Oct 2009
    Posts
    2

    Thanks a lot

    Thanks A lot Man I appreciate your help.
    Again thanks a lot .

    Regards
    Fahed
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. How to find the pairs?
    Posted in the Number Theory Forum
    Replies: 10
    Last Post: September 8th 2011, 11:21 AM
  2. Probability of getting 2 pairs
    Posted in the Statistics Forum
    Replies: 6
    Last Post: March 10th 2011, 01:26 PM
  3. How many different ordered pairs?
    Posted in the Geometry Forum
    Replies: 4
    Last Post: November 12th 2008, 05:37 PM
  4. Find all pairs (x, y)
    Posted in the Algebra Forum
    Replies: 1
    Last Post: October 24th 2008, 09:05 AM
  5. Pairs of (x,y)
    Posted in the Math Topics Forum
    Replies: 4
    Last Post: May 28th 2007, 08:11 AM

Search Tags


/mathhelpforum @mathhelpforum