maths.free › Combinatorics & Graph Theory › Strings, Sets, and Binomial Coefficients › Discussion
Discussion
Over coffee, Xing said that he had been experimenting with the SageMath software discussed in . He understood that SageMath was treating a big integer as a string.
Discussion
Over coffee, Xing said that he had been experimenting with the SageMath software discussed in . He understood that SageMath was treating a big integer as a string. Xing enthusiastically reported that he had asked SageMath to find the sum \(a+b\) of two large integers \(a\) and \(b\), each having more than \(800\) digits. The software found the answer about as fast as he could hit the enter key on his netbook. That's not so impressive, Alice interjected. A human, even Bob, could do this in a couple of minutes using pencil and paper.
Thanks for your kind remarks, replied Bob, with the rest of the group noting that that Alice was being pretty harsh on Bob and not for any good reason.
Dave took up Bob's case by remarking, Very few humans, not even you Alice, would want to tackle finding the product of \(a\) and \(b\) by hand. Xing jumped back in with, That's the point. Even a tiny netbook can find the product very, very quickly. In fact, I tried it out with two integers, each having more than one thousand digits. It found the product in about one second. Ever the skeptic, Zori said, You mean you carefully typed in two integers of that size? Xing quickly replied Of course not. I just copied and pasted the data from one source to another. Yolanda said, What a neat trick that is. Really cuts down the chance of an error.
Dave said What about factoring? Can your netbook with its fancy software for strings factor big integers? Xing said that he would try some sample problems and report back. Carlos said Factoring an integer with several hundred digits is likely to be very challenging, not only for a netbook, but also for a super computer. For example, suppose the given integer was either a prime or the product of two large primes. Detecting which of these two statements holds could be very difficult.
Undeterred, Dave continued, What about exponentiation? Can your software calculate \(a^b\) when \(a\) and \(b\) are large integers? Xing said That shouldn't be a problem. After all, \(a^b\) is just multiplying \(a\) times itself a total of \(b\) times, and if you can do multiplication quickly, that's just a loop. Yolanda said that the way Xing was describing things, he was actually talking about a program with nested loops so it might take a long time for such a program to halt. Carlos was quiet but he thought there might be ways to speed up such computations.
By this time, Alice reinserted herself into the conversation: Hey guys. While you were talking, I was looking for big integer topics on the web and found this problem. Is \(838200020310007224300\) a Catalan number? How would you answer this? Do you have to use special software?
Condensed: the full section is in Keller & Trotter, Applied Combinatorics.
À vous Aucune calculatrice ne tranche celle-ci, mais ses éléments sont calculables. Essayez-en un ci-dessous, ou tapez le vôtre.
Un compte gratuit ajoute des notes sur chaque leçon, un enregistrement de ce que vous avez terminé, vos problèmes résolus en un seul endroit, et un tuteur que vous pouvez demander sur cette page. Les maths eux-mêmes sont ouverts à tout le monde, signé ou non.
Inscription ConnexionSymboles utilisés ici
Appuyez sur n'importe quel symbole pour la définition complète, une image et ce que signifie chaque lettre.
Questions posées par les gens
Permutation or combination?
Ask whether order matters. A lock code is a permutation (order matters); a hand of cards is a combination (it does not).
What is a graph in this sense?
Dots (vertices) joined by lines (edges), not a plot. Road maps, social networks and molecules are graphs; questions like "is there a route" and "how few colours" are graph theory.
Certaines parties de cette page sont adaptées de Keller & Trotter, Applied Combinatorics (CC BY-SA 4.0). Condensés et réexpliqués ici ; les erreurs sont les nôtres.
Plus en Combinatorics & Graph Theory
The counting principlesPigeonhole principle and inclusion, exclusionBinomial coefficients and Pascal's triangleRecurrences and generating functionsGraphs: vertices, edges, degreesPaths, cycles, trees, Euler and HamiltonColouring and planar graphs