NUMBERS?

  • (2 Pages)
  • +
  • 1
  • 2

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

#16 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9587
  • View blog
  • Posts: 36,326
  • 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?
Was This Post Helpful? 0
  • +
  • -

#17 zedth2  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • 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.
Was This Post Helpful? 0
  • +
  • -

#18 Aphex19  Icon User is offline

  • Born again Pastafarian.
  • member icon

Reputation: 615
  • View blog
  • 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

Was This Post Helpful? 0
  • +
  • -

#19 lordofduct  Icon User is offline

  • I'm a cheeseburger
  • member icon


Reputation: 2538
  • View blog
  • Posts: 4,641
  • 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.
Was This Post Helpful? 0
  • +
  • -

#20 e_i_pi  Icon User is offline

  • = -1
  • member icon

Reputation: 801
  • View blog
  • Posts: 1,700
  • 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.
Was This Post Helpful? 1
  • +
  • -

#21 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 8037
  • View blog
  • Posts: 13,757
  • 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?
Was This Post Helpful? 0
  • +
  • -

#22 Karel-Lodewijk  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 452
  • View blog
  • Posts: 857
  • Joined: 17-March 11

Re: NUMBERS?

Posted 04 March 2012 - 03:23 PM

View Poste_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

Was This Post Helpful? 2
  • +
  • -

#23 sepp2k  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2153
  • View blog
  • Posts: 3,315
  • Joined: 21-June 11

Re: NUMBERS?

Posted 05 March 2012 - 01:07 AM

View Poste_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).


View PostKarel-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.
Was This Post Helpful? 2
  • +
  • -

#24 e_i_pi  Icon User is offline

  • = -1
  • member icon

Reputation: 801
  • View blog
  • Posts: 1,700
  • Joined: 30-January 09

Re: NUMBERS?

Posted 05 March 2012 - 02:27 AM

Good pick ups karel and sepp :)
Was This Post Helpful? 0
  • +
  • -

#25 GetSet  Icon User is offline

  • D.I.C Head

Reputation: 5
  • View blog
  • Posts: 122
  • Joined: 08-February 11

Re: NUMBERS?

Posted 05 March 2012 - 06:32 PM

View Postzedth2, 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.
Was This Post Helpful? 0
  • +
  • -

#26 Karel-Lodewijk  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 452
  • View blog
  • Posts: 857
  • Joined: 17-March 11

Re: NUMBERS?

Posted 17 March 2012 - 04:44 AM

View PostGetSet, on 06 March 2012 - 01:32 AM, said:

View Postzedth2, 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.
Was This Post Helpful? 0
  • +
  • -

#27 creekist  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • 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.
Was This Post Helpful? 0
  • +
  • -

#28 turboscrew  Icon User is offline

  • D.I.C Addict

Reputation: 100
  • View blog
  • Posts: 644
  • 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.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2