# NUMBERS?

• (2 Pages)
• 1
• 2

## 27 Replies - 3127 Views - Last Post: 19 April 2012 - 05:44 AM

### #16 modi123_1

• Suitor #2

Reputation: 13953
• Posts: 55,693
• Joined: 12-June 08

## Re: NUMBERS?

Posted 01 March 2012 - 01:42 PM

Why not use a generic object type and build up from there?

### #17 zedth2

Reputation: 2
• Posts: 121
• Joined: 14-September 09

## Re: NUMBERS?

Posted 01 March 2012 - 01:46 PM

It was just to see if I could. It just led to me trying to figure out numbers.

### #18 Aphex19

• Born again Pastafarian.

Reputation: 618
• Posts: 1,873
• Joined: 02-August 09

## Re: NUMBERS?

Posted 02 March 2012 - 07:38 AM

It's could be considered quite philosophical, but really numbers are simply a way of quantifying things, and more abstractly, applying symbolic meaning to those quanitities. That's the way I see it.

Perhaps I've missed the point a bit there though. I agree with sepp2k; the idea of proving numbers as a concept in itself (mathematically) makes no sense.

This post has been edited by Aphex19: 02 March 2012 - 07:43 AM

### #19 lordofduct

• I'm a cheeseburger

Reputation: 2668
• Posts: 4,786
• Joined: 24-September 10

## Re: NUMBERS?

Posted 02 March 2012 - 08:09 AM

number theory is your only bet then, if that's what you want to do.

It's a big subject, it's a fun subject as well... as long as you have a hard-on for math. As far as I can tell, you have a hard-on for math.

We won't be getting into the proofs here because that's just regurgitating in an abridged form tons of information that already exists out there. Go read about it now that you know what the subject field is.

### #20 e_i_pi

• = -1

Reputation: 879
• Posts: 1,893
• Joined: 30-January 09

## Re: NUMBERS?

Posted 02 March 2012 - 08:24 AM

An integer is a datatype. The integers, as a whole, form a set. This set is commonly represented using the letter Z, though the diagonal on the Z has two strokes, like this.

Addition and subtraction are operations, as are multiplication and division.

When you combine a set with an operation, you form what is called a Group, though a Group can only exist if certain rules are adhered to, those being Closure, Associativity, Identity and Inverse.

The integers under addition, subtraction, or multiplication forms a group. The integers under division does not, as it breaches the rules regarding Closure and Inverse.

Additional to this, a Group can be considered to be an Abelian Group if it adheres to the rule of Commutativity. The integers under subtraction is a Group, but not an Abelian Group, since 2-1 != 1-2, for instance.

Not sure if any of this clears things up, but it gives you some food for thought.

You may want to look into Groups on Wikipedia, or you could alternately fry your brain by having a cursory glance at an image that demonstrates the relationship between the various algebraic structures used in mathematics.

### #21 jon.kiparsky

• Beginner

Reputation: 11021
• Posts: 18,804
• Joined: 19-March 11

## Re: NUMBERS?

Posted 02 March 2012 - 10:16 AM

I'm still not sure what on earth a "proof for numbers" would be. Unless you mean to recreate the Principia, in which case you should read Goedel first.

What is it you're trying to prove?

### #22 Karel-Lodewijk

Reputation: 454
• Posts: 864
• Joined: 17-March 11

## Re: NUMBERS?

Posted 04 March 2012 - 03:23 PM

e_i_pi, on 02 March 2012 - 03:24 PM, said:

An integer is a datatype. The integers, as a whole, form a set. This set is commonly represented using the letter Z, though the diagonal on the Z has two strokes, like this.

Addition and subtraction are operations, as are multiplication and division.

When you combine a set with an operation, you form what is called a Group, though a Group can only exist if certain rules are adhered to, those being Closure, Associativity, Identity and Inverse.

The integers under addition, subtraction, or multiplication forms a group. The integers under division does not, as it breaches the rules regarding Closure and Inverse.

Additional to this, a Group can be considered to be an Abelian Group if it adheres to the rule of Commutativity. The integers under subtraction is a Group, but not an Abelian Group, since 2-1 != 1-2, for instance.

Not sure if any of this clears things up, but it gives you some food for thought.

You may want to look into Groups on Wikipedia, or you could alternately fry your brain by having a cursory glance at an image that demonstrates the relationship between the various algebraic structures used in mathematics.

It deserves mention that the integers in a computer are not really the same as their mathematical interpretation. Integers in a computer have a finite range.

It might be fun to verify if the computer integers under + still forms a group (given overflow is implemented).

EDIT: As sepp2k pointed out {Z,-} was never a group in the first place.

This post has been edited by Karel-Lodewijk: 05 March 2012 - 04:52 AM

### #23 sepp2k

• D.I.C Lover

Reputation: 2577
• Posts: 4,113
• Joined: 21-June 11

## Re: NUMBERS?

Posted 05 March 2012 - 01:07 AM

e_i_pi, on 02 March 2012 - 04:24 PM, said:

Additional to this, a Group can be considered to be an Abelian Group if it adheres to the rule of Commutativity. The integers under subtraction is a Group, but not an Abelian Group, since 2-1 != 1-2, for instance.

They aren't a group under subtraction either because subtraction is not associative: (3 - 2) - 1 != 3 - (2 - 1).

Karel-Lodewijk, on 04 March 2012 - 11:23 PM, said:

It might be fun to verify if the computer integers under +,- still form groups (given overflow is implemented).

They are under + (they're not a group under - for the same reason that proper integers aren't). Integer arithmetic with overflow is the same as arithmetic module MAX_UINT. And since for all n the set of congruence classes modulo n is an abelian group under addition, so is integer arithmetic with overflow.

### #24 e_i_pi

• = -1

Reputation: 879
• Posts: 1,893
• Joined: 30-January 09

## Re: NUMBERS?

Posted 05 March 2012 - 02:27 AM

Good pick ups karel and sepp

### #25 GetSet

• D.I.C Regular

Reputation: 44
• Posts: 411
• Joined: 08-February 11

## Re: NUMBERS?

Posted 05 March 2012 - 06:32 PM

zedth2, on 01 March 2012 - 01:41 PM, said:

It's really just an experiment I'm doing on my own. Speed and how efficient it is really isn't an issue right now. But basically what started all this was I had to develop and algorithm to do subtraction then I went through and tried to prove it and then started looking at basic proofs which then lead to trying to find a proof for numbers.

You'll find the division part to be the trickiest -- at least it was for me. Addition is straightforward. Multiplication there's a workaround. Subtraction though and division, ... I'll still haven't finished that program. Need to dedicate some time to that. It served it's purpose though -- used it to calculate factorial and binomial tables for reference (discrete mathematics class, CS major).

Nonetheless, I like the idea of an integer class based on strings (such already exists of course, but imagine a whole OS that natively uses it, probably already exist too), despite the slow speed factor mentioned earlier. Back in the day, fixed width ordinal data types were mainly due to space (memory) considerations. Not so much a problem anymore given the advances in memory capacity technology.

"You'll find the division part to be the trickiest -- at least it was for me."

In reference to string numbers.

### #26 Karel-Lodewijk

Reputation: 454
• Posts: 864
• Joined: 17-March 11

## Re: NUMBERS?

Posted 17 March 2012 - 04:44 AM

GetSet, on 06 March 2012 - 01:32 AM, said:

zedth2, on 01 March 2012 - 01:41 PM, said:

It's really just an experiment I'm doing on my own. Speed and how efficient it is really isn't an issue right now. But basically what started all this was I had to develop and algorithm to do subtraction then I went through and tried to prove it and then started looking at basic proofs which then lead to trying to find a proof for numbers.

You'll find the division part to be the trickiest -- at least it was for me. Addition is straightforward. Multiplication there's a workaround. Subtraction though and division, ... I'll still haven't finished that program. Need to dedicate some time to that. It served it's purpose though -- used it to calculate factorial and binomial tables for reference (discrete mathematics class, CS major).

Nonetheless, I like the idea of an integer class based on strings (such already exists of course, but imagine a whole OS that natively uses it, probably already exist too), despite the slow speed factor mentioned earlier. Back in the day, fixed width ordinal data types were mainly due to space (memory) considerations. Not so much a problem anymore given the advances in memory capacity technology.

"You'll find the division part to be the trickiest -- at least it was for me."

In reference to string numbers.

Indeed they already exist, there are many so called bignum libraries out there. They however do not use strings of decimal digits but usually strings/arrays of 32bit/64bit integers (whatever is native to the system). The algorithms you would use are not so different though, it's just doing math, not in a base of 2, not in a base of 10 but in base 2^32 or 2^64. Or in other words every 32bit/64bit int is considered a digit of the larger number.

Many programming languages do use them natively. Python/Ruby/Haskell that I know of will silently switch to a bignum library when a result would overflow the native integer type.

### #27 creekist

Reputation: 0
• Posts: 7
• Joined: 19-April 12

## Re: NUMBERS?

Posted 19 April 2012 - 02:38 AM

I wrote an intzilla once.

It was a pain in the ass.

### #28 turboscrew

• D.I.C Lover

Reputation: 164
• Posts: 1,057
• Joined: 03-April 12

## Re: NUMBERS?

Posted 19 April 2012 - 05:44 AM

I recall that the theory of numbers start with sets: empty set, set with an empty set as an element, set with an empty set and and a set containing an empty set...

The numbers are the cardinality of the sets generated this way.

Two sets are the same if their elements are the same: that's why the different "levels" of sets containing an empty set. The empty set to abstract out any "meaning" of the sets.

That's why object oriented methods cannot be based on mathematics even if a lot of effort is made to do so for the "glory of THE science".
In math the female presidents of USA are cows with wings. Both sets are empty and thus are the same set.