Page 3 of 3

Posted: Tue Apr 16, 2013 9:53 pm
by AMindForeverVoyaging
CodeX wrote:I think the page you get after solving a challenge points you to the Challenges form instead of the Challenges Solved one
Quite certainly not in every case, but for some challenges this seems to be what is happening.

Posted: Sat Apr 27, 2013 5:27 pm
by meis
I'm sorry, but I can't get how could in 8 days be 47 population. I have written a script which gives:
day: 1 - bacts: 0,1,0,0,0 - sum: 1
day: 2 - bacts: 1,0,1,0,0 - sum: 2
day: 3 - bacts: 1,1,0,1,0 - sum: 3
day: 4 - bacts: 1,1,1,0,1 - sum: 4
day: 5 - bacts: 2,1,1,1,0 - sum: 5
day: 6 - bacts: 2,2,1,1,1 - sum: 7
day: 7 - bacts: 3,2,2,1,1 - sum: 9
day: 8 - bacts: 4,3,2,2,1 - sum: 12
day: 9 - bacts: 5,4,3,2,2 - sum: 16

the array of bacts is the succession of days (batters at 1st day of life, batters at 2nd etc...)

What have I done wrong?

p.s. day 0 is 1,0,0,0,0

Posted: Fri May 03, 2013 2:44 pm
by meis
Oh, now I get it, I've made a mistake in the understanding of the moment of the reproduction. Done :D

Posted: Tue Jun 04, 2013 6:45 pm
by Luk.Online
I think I've programmed the correct algorithm, but is the only way to figure out the answer by iterate

Code: Select all

while (amount < 1000000000000);
???

Posted: Tue Jun 04, 2013 7:41 pm
by CodeX
Luk.Online wrote:I think I've programmed the correct algorithm, but is the only way to figure out the answer by iterate

Code: Select all

while (amount < 1000000000000);
???
I'm not going to Fib, Lucas can solve it with a closed-form equation.

Posted: Tue Jun 04, 2013 8:42 pm
by Luk.Online
I've got an equation for the growth but not for the death...

But when I've got one for the death, can I subtract them?

Posted: Mon Jun 29, 2015 10:51 am
by FrostyHacks
My solution to this was simply to write a C# app and keep track of the number of bacteria on each specific day.

So each day iteration would basically be the number of day 5 bacteria (those dead) increased by the amount from the previous day, so day 4 become day 5, day 3 become day 4, day 2 become day 3, day 1 become day 2, and day 1 is the addition of day 2+3 since those days result in new bacteria.

The total alive is just day 1+2+3+4 and the total dead is just the size of day 5

The code looks like this, you can simply hit enter to generate each new day and you'll see the totals and then skip through the days until you reach one high enough, or you could modify the code to just keep looping until the total count condition is met, I made this more general, you can put a different starting number in for example.

Posted: Sat Jul 04, 2015 7:30 am
by AMindForeverVoyaging
FrostyHacks, you are not supposed to post a complete solution in this section of the forum. That's what the "Challenges Solved" section is for. There, only the people who have solved a challenge can read the thread for that challenge. So it's perfectly fine to post all of your solutions there.

Posted: Wed Nov 11, 2015 6:55 am
by Bwill
So I just solved this using

Code: Select all

while (population < 1000000000000)
    growBacteria()
...
Yet I am curious about the "simple algebraic" and Fibonacci solutions, anyone mind PMing me those solutions?

Posted: Wed Nov 11, 2015 6:47 pm
by eulerscheZahl
As soon as you solved the challenge, you have access to the solution forum: http://www.hacker.org/forum/viewtopic.p ... c&start=15