-1

implemented a solution to a problem in arithmetic precision handeling in gmp - but the results are rather strange . as a part of troubleshooting I was wondering whether there is any other package hich woudl allow similar operatiosn as gmp in R. I would need something like chooseZ and multiplication of numbers larger than 2^64 - jsu to make sure that I am not having an error somewhere in this step of my script

need to compute nubers like

choose(2450,765) then multiply it with a floating point number like 0.0034

the log solution is not really working becasue the expression can aslo be

sum for 2 to k of (k* k*choose(1800,800)*0.089)

so Iw ould need a wauy to sum over (k kchoose(1800,800)*0.089)

IRTFM
  • 240,863
  • 19
  • 328
  • 451
heineman
  • 25
  • 6
  • 1
    "Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – zero323 Jun 21 '15 at 14:14
  • did edit question ...no real answer th – heineman Jun 21 '15 at 15:47
  • 2
    I would just like to point out that the overall appearance of your writing (typos, missing letters or whole parts of words and even sentences, ...) shows an appalling lack of respect to your readers. – Roland Jun 21 '15 at 16:04
  • 1
    You edited? Seems doubtful. Agree that with Roland that you would get more serious attention if you capitalized the beginning of sentences, spelled words correctly (especially the word 'number') and formatted with the SO tools. You should learn to search as well, so rather than giving you what I think is the answer, I'm presenting it as an simple puzzle in code: first search for a searching package, install it , load and run: `findFn("factorial arbitrary precision")` – IRTFM Jun 21 '15 at 16:50

1 Answers1

2

You could just work on the logarithmic scale:

lchoose(2450,765) + log(0.0034)
#[1] 1511.433

If you exponentiate this, you get a really big number. I simply do not believe that this number would be different from Inf for any practical purpose and I believe even less that you'd need it to exact precision.

Edit:

If you want to calculate \sum_{i=2}^k{i^2 * choose(1800, 800) * 0.089}, you should see that this is the same as choose(1800, 800) * \sum_{i=2}^k{i^2 * 0.089} and then you can again work on the logarithmic scale.

Roland
  • 117,893
  • 9
  • 163
  • 255
  • how would you do log on the exporession sum for 2 to k of (k*k*choose(1800,800)*0.089) – heineman Jun 21 '15 at 15:11
  • because I need to sum different terms ...then it gets difficult with logs unless i redo it in real numbers but then i need a big number thin – heineman Jun 21 '15 at 15:12
  • You need to step back and rethink your problem. If you sum the diameters of the Earth and Venus orbits you don't need this exact to the cm. – Roland Jun 21 '15 at 15:17
  • no but I need some result si dont care whethe rit is 1000 of or so..but how woudli get another ersult except for gmp... – heineman Jun 21 '15 at 15:19
  • but coudl youi not give an aanwert to that then? – heineman Jun 21 '15 at 15:47
  • You really need to think about the maths. See the edit. – Roland Jun 21 '15 at 15:54