Author |
Message |
EddArmitage
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 9:40 pm Posts: 5288 Location: ln -s /London ~
|
I've hacked something together for that now, and after realising that I can't count (even using fingers) it works.
|
Thu Mar 25, 2010 1:50 pm |
|
 |
Fogmeister
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 7:35 pm Posts: 6580 Location: Getting there
|
OMG I'm could kick myself! I missed 18! Project 14 is my next victim  I've done 1, 2, 5, 6, 7, 8, 9 and 17 now 
|
Thu Mar 25, 2010 3:10 pm |
|
 |
EddArmitage
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 9:40 pm Posts: 5288 Location: ln -s /London ~
|
That's (almost) my level of error! (8-p)
|
Thu Mar 25, 2010 3:31 pm |
|
 |
finlay666
Spends far too much time on here
Joined: Thu Apr 23, 2009 9:40 pm Posts: 4876 Location: Newcastle
|
I have NEARLY got Ackermann done  Only real problem is its VERY slow as instead of using recursion it uses the stack Might use a stopwatch for it actually to see just how long it takes!
_________________TwitterCharlie Brooker: Macs are glorified Fisher-Price activity centres for adults; computers for scaredy cats too nervous to learn how proper computers work; computers for people who earnestly believe in feng shui.
|
Thu Mar 25, 2010 4:08 pm |
|
 |
Fogmeister
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 7:35 pm Posts: 6580 Location: Getting there
|
Nice one! Could you explain how you did it if you ever get it done? I can't understand how to do it without using recursion.
|
Thu Mar 25, 2010 4:24 pm |
|
 |
finlay666
Spends far too much time on here
Joined: Thu Apr 23, 2009 9:40 pm Posts: 4876 Location: Newcastle
|
using a stack, by pushing/popping values until you get to the end, call stack would get STUPIDLY high otherwise, as in over 200,000 recursive calls, c# in VS 2008 barfs with stack overflow at 9000 or so I think C/Java are not suitable languages to solve it in due to the complexity and heavily recursive nature Having seen how others do it it seems there is a nicer way to do it, as it converges after time http://www.jstor.org/pss/2323780
_________________TwitterCharlie Brooker: Macs are glorified Fisher-Price activity centres for adults; computers for scaredy cats too nervous to learn how proper computers work; computers for people who earnestly believe in feng shui.
|
Thu Mar 25, 2010 4:44 pm |
|
 |
Fogmeister
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 7:35 pm Posts: 6580 Location: Getting there
|
Well... 14 has stumped me for now.
I've rewritten it several ways and I keep coming out with the exact same answer.
|
Thu Mar 25, 2010 9:46 pm |
|
 |
finlay666
Spends far too much time on here
Joined: Thu Apr 23, 2009 9:40 pm Posts: 4876 Location: Newcastle
|
You should use a BigInteger or similar, largest dataset you can really, thinking about doing it based on bit flags actually as I can have a 256bit number then... EDIT: did it adapting the algorithm I had to start at 1 million and count down, and to use var instead of a set variable type, seemed to stop the number changing the -ve bit to set it to a huge negative number by mistake and it was pretty quick 
_________________TwitterCharlie Brooker: Macs are glorified Fisher-Price activity centres for adults; computers for scaredy cats too nervous to learn how proper computers work; computers for people who earnestly believe in feng shui.
Last edited by finlay666 on Thu Mar 25, 2010 10:08 pm, edited 1 time in total.
|
Thu Mar 25, 2010 9:58 pm |
|
 |
Fogmeister
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 7:35 pm Posts: 6580 Location: Getting there
|
But with 14 the numbers aren't ever going to be big enough to warrant that are they?
|
Thu Mar 25, 2010 10:05 pm |
|
 |
finlay666
Spends far too much time on here
Joined: Thu Apr 23, 2009 9:40 pm Posts: 4876 Location: Newcastle
|
you would be surprised how big they get and how long the chains go on for (over 500 iterations)
_________________TwitterCharlie Brooker: Macs are glorified Fisher-Price activity centres for adults; computers for scaredy cats too nervous to learn how proper computers work; computers for people who earnestly believe in feng shui.
|
Thu Mar 25, 2010 10:09 pm |
|
 |
Fogmeister
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 7:35 pm Posts: 6580 Location: Getting there
|
Well, that explains why my answer was wrong then  Reworking it now.
|
Thu Mar 25, 2010 10:12 pm |
|
 |
Fogmeister
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 7:35 pm Posts: 6580 Location: Getting there
|
Done problem 10 now. Although I think my answer was too complex, I'm sure I'd be able to re do it a lot more simply.
|
Tue Mar 30, 2010 8:34 pm |
|
 |
finlay666
Spends far too much time on here
Joined: Thu Apr 23, 2009 9:40 pm Posts: 4876 Location: Newcastle
|
I'm stopping for a while because I have my exam on Thursday and apparently they are able to send the test this time 
_________________TwitterCharlie Brooker: Macs are glorified Fisher-Price activity centres for adults; computers for scaredy cats too nervous to learn how proper computers work; computers for people who earnestly believe in feng shui.
|
Tue Mar 30, 2010 8:39 pm |
|
 |
Fogmeister
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 7:35 pm Posts: 6580 Location: Getting there
|
Well I've gone back today and had a look at a few more. Some of them I thought were insanely impossible when I was looking at them previously but today I've rattled through several of them. So far I've done... 1, 2, 5, 6, 7, 8, 9, 10, 17, 19, 22, 28, 42 and 79. 79 I was able to solve by hand in under a minute.  22 and 42 were very similar with only a couple of changes required. 19 was easy also as the code we use at work has a date data type with all the associated methods. 28 was also not too hard once I realised a pattern.
|
Mon Aug 15, 2011 1:19 pm |
|
 |
jonlumb
Spends far too much time on here
Joined: Thu Apr 23, 2009 6:44 pm Posts: 4141 Location: Exeter
|
For some reason I've only just discovered this; will have a play with it this evening (don't fancy trying to do it in an Excel Macro  )
_________________ "The woman is a riddle inside a mystery wrapped in an enigma I've had sex with."
|
Mon Aug 15, 2011 2:48 pm |
|
|