Cantor Expansion Addition algorithm?

In summary, a procedure is provided to convert a decimal number to a Cantor expansion. The expansion for a given number x is determined by finding the remainder of x divided by n+1, where n is incremented until y (a temporary variable) is equal to 0. To add two Cantor expansion numbers together, further assistance is needed.
  • #1
raross
12
0
Could someone help me and write an algorithm to add 2 Cantor expansions. The algorithm to get a decimal number to cantor expansion is:

procedure decimal-to-cantor(x: positive integer)
n := 1
y := x fy is a temporary variable used so that
this procedure won't destroy the original value of x.g
while y 6= 0
begin
an := y mod (n+1)
y := (y-an )/(n+1)
n := n + 1
end
f The expansion for x will be an n! + an−1 (n-1)! + : : : + a22! + a1 . g

Now i just need to figure out how to add 2 cantor expansion numbers together to get one. Someone help please!
 
Physics news on Phys.org
  • #2
How come no one can help me ? =/
 
  • #3
Well, I can't because I've never heard of a Cantor expansion before (at least not by that name).
 

1. What is the Cantor Expansion Addition algorithm?

The Cantor Expansion Addition algorithm is a method for adding two numbers in a binary representation. It is named after Georg Cantor, a German mathematician, and is also known as the Cantor Addition or Cantor Pairing function.

2. How does the Cantor Expansion Addition algorithm work?

The algorithm works by converting the two numbers into binary representations and then combining the digits from each number to form a new number. This new number is then converted back to decimal form.

3. What are the advantages of using the Cantor Expansion Addition algorithm?

One advantage of this algorithm is that it can be used to add very large numbers without the risk of overflow. It also allows for efficient addition of binary numbers, making it useful in computer programming and cryptography.

4. Are there any limitations to the Cantor Expansion Addition algorithm?

The main limitation of this algorithm is that it can only be used to add two numbers at a time. It also requires the numbers to be in binary form, so it may not be suitable for all types of addition.

5. How is the Cantor Expansion Addition algorithm used in real-world applications?

This algorithm is commonly used in computer programming and cryptography, where efficient addition of binary numbers is necessary. It can also be used in combinatorial games and number theory problems.

Similar threads

  • Calculus and Beyond Homework Help
Replies
32
Views
2K
  • Calculus and Beyond Homework Help
Replies
3
Views
811
  • Calculus and Beyond Homework Help
Replies
19
Views
2K
  • Programming and Computer Science
Replies
1
Views
952
  • Calculus and Beyond Homework Help
Replies
1
Views
2K
  • Calculus and Beyond Homework Help
Replies
6
Views
1K
  • Calculus and Beyond Homework Help
Replies
4
Views
1K
  • Calculus and Beyond Homework Help
Replies
6
Views
1K
  • Calculus and Beyond Homework Help
Replies
5
Views
1K
  • Calculus and Beyond Homework Help
Replies
2
Views
712
Back
Top