User Tools

Site Tools


haas:fall2012:common:discrete-p02-20120927235959

To continue both our explorations of BigNum and general explorations of numbers/counting (a very discrete thing for sure!), I'd like each person in the class to try their hand at implementing the bignum increment() function, according to the function signature present in include/bignum.h

Not only will this test you understanding of working with a multi-file codebase, and one you did not implement yourself from the ground up (great real world experience for ANYONE working with a software library, which this essentially is), but it will get you in touch with some good algorithmic thinking on the concept on incrementation.

Sure, we can all do it in our head. Sure, we've done it forever. But that often makes implementing it more difficult that it may seem. There are steps that need to take place that we've taken for granted FOR YEARS which we'll need to stop taking for granted.

We'll almost need to unlearn how to increment and relearn it so we can better understand the steps involved. And hey, that's exactly what Discrete Structures is all about (learning about how some computationally-important manipulations of numbers work, and why).

The end algorithm ultimately isn't that hard. The code isn't that long. But until you truly understand how increment works, this might seem quite difficult.

Just remember, it isn't the code so much as your understanding of the process (or lack thereof).

Don't be afraid to find a math book or useful site on the internet with information in incrementing. Or hunt out a tutor (for learning about increment– independent of the code, even the Math Learning Center might be of some value– but please don't ask them coding questions, I expect many of them will only be able to help you understand the math).

Do not add/commit your increment code to the bignum repository– yet. If everyone did, we'd have crazy conflicts and seemingly lost code- quite the nightmare.

Make your implementation in ops/increment.c (but don't hg add/commit it yet) You might want to back up the existing increment.o file, just in case you need to put it back in place to verify results.

If your increment works, the testing/incdectest.c program should “just work” when you compile your increment.c file (all you'll need to do is type “make” in the ops/ directory, then wander over to testing/ and recompile incdectest.c).

I'd like to be able to compare the different increment implementations, so we can get a good feel for approaches and algorithmic complexity and efficiency.

For this project, you may assume and run with one particular base (be it 2, 7, 10, 16). But a follow-up project will have you expand your algorithm to support any base (from potentially 2-36).

Questions are good. Be sure to ask them.

haas/fall2012/common/discrete-p02-20120927235959.txt · Last modified: 2012/09/20 12:58 by 127.0.0.1