Is there any algorithm which can shorten a certain very large big integer?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Atiq ur Rehman
    New Member
    • Dec 2010
    • 2

    Is there any algorithm which can shorten a certain very large big integer?

    Hi Everybody,
    This is the first time I have ever posted a question so I may not be familiar with the pattern to adopt. Hereunder my problem goes.


    I have a function which generates a very large Integer (I do this by using Biginteger from vjslib.dll and I am able to operate all kind of arithmetic operators on such a biginteger.)

    But, My goal is to shorten this biginteger into a small integer. Is there any algorithm? or a mathematical Formula which I can use to represent it in a small integer and use some reverse formula to get the original Biginteger?

    The big integer my function creates goes like this:
    987612101123134 893759879561574 623648648234587 945723457348568 346586823456861 312374908137793 245792345793475 897836587236458 678234568234658 362458762347895 689324568923465 786361238467153 761234757457236 456663824768734 612834681236481 236481634138461 238467834576341 236412783461278 346781236481263 489126348971238 411346812734678 12364789

    I do not want to represent my bigInteger in a higher base as it will not be possible to do conversion into higher bases with such a large integer.

    Anyone who can help me out with this question, I shall be very thankful to him.
  • Stewart Ross
    Recognized Expert Moderator Specialist
    • Feb 2008
    • 2545

    #2
    Hi. As far as I know it is not possible to transfer your very large number to an equivalent smaller whole-number container of some kind unless you change the number's base, which you've already said you cannot do.

    It may well be possible to compress your large number using a compression algorithm to shorten and replace combinations of digits, but the end result would not be a smaller integer as such, but a coded representation of the larger value. This encoded value would not be a numeric value as such, but a compressed representation of a numeric value whose components will depend on the compression algorithm used. As this is not what you have asked for in your question I'd have to answer that it is not possible to create a 'smaller' true numeric representation of your large number without loss of information unless you go the base-change route that you've already ruled out.

    If your big integer value is generated as a text string then you can of course parse this down and extract the individual components into a long-integer array or similar, but as your question relates to converting whole number to whole number I'll leave this one as a possibility for you to consider in due course.

    -Stewart
    Last edited by Stewart Ross; Dec 8 '10, 04:02 PM.

    Comment

    • Atiq ur Rehman
      New Member
      • Dec 2010
      • 2

      #3
      Mr. Stewart. Thank you so much for putting your efforts on elaborating my concern.

      Stewart, I think the only possibility in achieving small whole number or array of small whole numbers out of a large string of numbers is to use combinations algorithm. These days I am studying the Fibonacci Number series and trying to incorporate it's logic somewhere in my algorithm.

      Stewart, i am also interested to parse this down to extract individual components into a long-integer array or similar. Can you provide me some coding pastern/examples to start with?

      Again I am so thankful to you for your kind advises on this matter.

      Comment

      Working...