All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Algorithms
Another Man's Floor (Posted on 2005-11-23) Difficulty: 4 of 5
Let a, b, and m be positive whole numbers. Required is a fast algorithm for evaluating Σk=0..m floor(ka/b), floor(x) being the greatest integer that does not exceed the real number x.

See The Solution Submitted by Richard    
Rating: 4.5000 (2 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
re: Solution (part 1) | Comment 5 of 11 |
(In reply to Solution (part 1) by Tristan)

Well, I'm back, but I still haven't finished this solution.  I seem to have hit a bit of a snag.  As I noted at the end of my last comment, the triangle is not necessarily a lattice triangle.  Pick's theorem (thanks to Hugo for naming it) doesn't quite work unless it's a lattice triangle.

And so, this is where, I suspect, the theoretical math ends, and the algorithm-writing begins.  The solution may not be as clean or fast as I expected (as in a closed expression).

I hope to write more later.

  Posted by Tristan on 2005-12-28 00:40:01

Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (1)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (18)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information