Nice competition => Math + programming

Post any maths and/or physics related questions here.

Moderators: Darobat, RecursiveS, Dante Shamest, Bugdude, Wizard

Nice competition => Math + programming

Postby Safari » Thu Oct 21, 2004 1:31 pm

http://www.mathschallenge.net/index.php?section=project

Right now I've got 3% Genius. It really gives some challange :)

Hope to find out how it goes for you guys :)
User avatar
Safari
 
Posts: 1362
Joined: Sun Sep 19, 2004 11:07 am

Postby Alvaro » Fri Oct 22, 2004 10:15 am

Nice website! I don't find most of the problems very challenging, but I think a lot of people will. I am at 25% right now, but I seem to be able to do any problem that I put my mind to. It just takes time (but it's fun).

There are some problems that are really hard unless you have a good grasp of number theory.
User avatar
Alvaro
Moderator
 
Posts: 5185
Joined: Mon Sep 22, 2003 4:57 pm
Location: NY, USA

Postby Safari » Fri Oct 22, 2004 11:04 am

For me it's hard :) :wink:
So what do you use? C++ (ofcourse) or just by pen and paper? :)
User avatar
Safari
 
Posts: 1362
Joined: Sun Sep 19, 2004 11:07 am

Postby Alvaro » Fri Oct 22, 2004 12:18 pm

Safari wrote:For me it's hard :) :wink:
So what do you use? C++ (ofcourse) or just by pen and paper? :)

I have used C++ for most of them, `bc' (a Unix command-line calculator) for some and a combination of pen and paper, C++ and bc for others.
User avatar
Alvaro
Moderator
 
Posts: 5185
Joined: Mon Sep 22, 2003 4:57 pm
Location: NY, USA

Postby exomo » Sat Oct 23, 2004 4:37 am

Just joined.

It's very hard for me. Just solved the very easy ones within no time. I've got 6% genius.
No idea how to do the harder ones. But let's see.
User avatar
exomo
 
Posts: 881
Joined: Fri Sep 26, 2003 12:30 pm
Location: germany->baden

Postby Safari » Sat Oct 23, 2004 1:44 pm

Many problems includes big numbers, how do you hande big numbers (bigger then long)?
User avatar
Safari
 
Posts: 1362
Joined: Sun Sep 19, 2004 11:07 am

Postby Guest » Sat Oct 23, 2004 5:00 pm

The biggest type for numbers I know is DWORDLONG. (64 bits on my compiler) You can handle numbers up to 19 digits. No idea how to handle really big numbers.

Please some help. (Alvaro perhaps)

allready got No. 48. It's not that hard if you just cut off the digits that are more than 10.

btw 12% genius
Guest
 

Postby Alvaro » Sat Oct 23, 2004 5:43 pm

Done. 100% genius. It has been fun.

For large numbers, I mostly used `bc -l' from the Linux command line, or `long long' (64 bits) in gcc. For two of the problems I actually needed to do non-trivial computations with very long numbers. I installed the gmp library and did them in very little time.

I am pleasantly surprised at how neat mpz_class is. I also used mpq_class for one of the problems. The last time I used gmp was about seven years ago, and they didn't have such niceties.

Anybody needs help with a particular problem?
Last edited by Alvaro on Sat Oct 23, 2004 5:58 pm, edited 1 time in total.
User avatar
Alvaro
Moderator
 
Posts: 5185
Joined: Mon Sep 22, 2003 4:57 pm
Location: NY, USA

Postby Kybo Ren » Sat Oct 23, 2004 5:51 pm

For numbers bigger than 64 bits, I suggest the Miracl library. I really like it. :)
Kybo Ren
C++ Beginner
 
Posts: 2049
Joined: Wed Feb 11, 2004 9:28 pm

Postby Ryan » Sat Oct 23, 2004 6:01 pm

Alvaro wrote:Done. 100% genius. It has been fun.


I am so not surprised. We already knew that you were 100% genius. ;)
Ryan
Moderator
 
Posts: 323
Joined: Sat Jun 12, 2004 1:34 pm

Postby Alvaro » Sat Oct 23, 2004 6:04 pm

Ryan wrote:I am so not surprised. We already knew that you were 100% genius. ;)


You should have told me earlier. It took me two days of coding to find out that I am a genius!!! :)
User avatar
Alvaro
Moderator
 
Posts: 5185
Joined: Mon Sep 22, 2003 4:57 pm
Location: NY, USA

Postby exomo » Sat Oct 23, 2004 6:40 pm

Hey Alvaro, could you please help me with problem 17.

I tried it 2 different ways but neither solution seems to be correct.

Here's my code: (everybody look away who hasn't solved it yet)

*edit* <code removed> *edit*

I can't think what is wrong. At least the "create a string and count the letters" method should work.

PLEEEEEAAAAASE give me a hint.
Last edited by exomo on Sun Oct 24, 2004 3:36 am, edited 1 time in total.
User avatar
exomo
 
Posts: 881
Joined: Fri Sep 26, 2003 12:30 pm
Location: germany->baden

Postby Alvaro » Sat Oct 23, 2004 6:45 pm

"fourty"

I did the same mistake. The correct spelling is "forty". Great minds think alike! :)
User avatar
Alvaro
Moderator
 
Posts: 5185
Joined: Mon Sep 22, 2003 4:57 pm
Location: NY, USA

Postby exomo » Sat Oct 23, 2004 6:53 pm

Alvaro wrote:
"fourty"

I did the same mistake. The correct spelling is "forty". Great minds think alike! :)


Thanks a lot, now i got it. I'll think about the thing with the great minds ;-) Perhaps it's hidden inside me.
User avatar
exomo
 
Posts: 881
Joined: Fri Sep 26, 2003 12:30 pm
Location: germany->baden

Postby Kybo Ren » Sat Oct 23, 2004 7:15 pm

Speaking of numbers, is
"unociento" correct?
I think you are supposed to say "ciento", but since you say "doscientos" is "unociento" acceptable?
Kybo Ren
C++ Beginner
 
Posts: 2049
Joined: Wed Feb 11, 2004 9:28 pm

Next

Return to Maths & Physics

Who is online

Users browsing this forum: No registered users and 0 guests

cron