Forum

> > Off Topic > Do you have what it takes to be a Programmer?
Forums overviewOff Topic overviewLog in to reply

English Do you have what it takes to be a Programmer?

40 replies
Page
To the start Previous 1 2 3 Next To the start

old Do you have what it takes to be a Programmer?

Lee
Moderator Off Offline

Quote
Do you have what it takes to be a programmer?

Note: This has nothing to do with programming, but it does contain several concepts that are crucial to the development of a style of rationalization that is essential to anyone interested in computer science.

This is a numerical mathematics challenge. You can use any tool available to you to solve the problems. The problems will come in sets that are related. After one person solves the current problem, I will post the next problem.

Problem 2.7.10

When viruses enter the somatic cells of a organism, they begin to rapidly replicate. In one particular instance, the number of viruses within an organism will double every four hours. Assuming that this is true for all cases, if 10,000 viral particles infect an organism, how long will it take for the number of viral particles to reach 1,000,000,000,000 (10^12)?

old Re: Do you have what it takes to be a Programmer?

Flacko
User Off Offline

Quote
Yeah, I think the hours it will take will be about 104.
Edit: According to a program I just wrote it takes between 104 and 108 hours
Spoiler >
edited 2×, last 08.02.10 05:08:59 pm

old Re: Do you have what it takes to be a Programmer?

DoP3
User Off Offline

Quote
It will take it about 112 hours.>that's an estimation, i think it's a teeny bit less.
let me get the precise calculation in a few minutes.

I used Ms calculator ;P
edited 3×, last 08.02.10 05:21:03 pm

old Re: Do you have what it takes to be a Programmer?

Lee
Moderator Off Offline

Quote
It's technically a little bit less than 108. The correct solution is

4*8ln(10)/ln(2) =~= 106 Hours

Problem 2.8.10

After the immune system kicks in, the virus grows by 160% every four hours. At the same time, 50,000 viral particles are eliminated per hour.

Once the number of viral particles within the organism's body exceed 10^12 individuals, the organism dies. Calculate how long it will take for an organism infected with 10,000 viral particles to die. (Use the methodology from the previous problem to solve for the time it takes to reach 1 million particles)

old Re: Do you have what it takes to be a Programmer?

SQ
Moderator Off Offline

Quote
Oh man, I'm too late

leegao has written
4*8ln(10)/ln(2) =~= 106 Hours

Why does this prints 108 then? I thought that's right
Edit: Got the problem, it gets more than 10^12 in my script.
Code:
Spoiler >


-- Second Question
I don't understand second one very well, because of these:
Starting with 10000 viral particles, right?

Quote
the virus grows by 160% every four hours.
But
Quote
50,000 viral particles are eliminated per hour.

50000 viral particles are eliminated, that's confusing me.
edited 1×, last 08.02.10 08:00:23 pm

old Re: Do you have what it takes to be a Programmer?

PlayerNoob
User Off Offline

Quote
leegao has written
4*8ln(10)/ln(2) =~= 106 Hours


Hmmm, tough question.
Time to make it simple!

4*8(10)/2 = 160 hours

Maybe this is why I'm not a programmer.


Spoiler >

old Re: Do you have what it takes to be a Programmer?

SQ
Moderator Off Offline

Quote
The problem I mentioned before was:
10000 - 50000 = - 40000
The answer would be: there is no answer, but that's wrong I guess.

Haven't you noticed it in your script? Your script doesn't look like idea of solution thought.
Probably I just can't understand Problem very well.

old Re: Do you have what it takes to be a Programmer?

Flacko
User Off Offline

Quote
I understood the same thing as blazzingxx did.
10,000 viral particles grow 40% per hour, but at the same time 50,000 of them die because of the inmune system.
10,000 + 4,000 - 50,000 = -36,000
They'd last about 15 minutes in the organism before they all die...
edited 1×, last 09.02.10 06:30:10 pm

old Re: Do you have what it takes to be a Programmer?

sonnenschein
User Off Offline

Quote
Flacko has written
I understood the same thing as blazzingxx did.
10,000 viral particles grow 40% per hour, but at the same time 50,000 of them die because of the inmune system.
10,000 + 4,000 - 50,000 = -36,000
They'd last about 15 minutes in the organism before they all die...

Awww, didn't read it again, my fault...

old Re: Do you have what it takes to be a Programmer?

Lee
Moderator Off Offline

Quote
Remember that the problem revolves around recursive growth.

I'll simplify it a bit:

There are currently 1,000,000 viruses within your body. The viruses grow 160% every 4 hours. At the same time, 50,000 viruses are eliminated. How long will it take for number of viruses to reach 10^12.

Hint: Try using a spreadsheet first.

old Re: Do you have what it takes to be a Programmer?

YellowBanana
BANNED Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
val = 100
set = false
years = 0
while(set == false) do
	years = years+1
	val = val * 1.6 - 5
	if(val > 1e+8) then
		print(years*4)
		set = true
	end
end

divide all numbers by 1e4.
recursion.

now gimme something challenging pls.

old Re: Do you have what it takes to be a Programmer?

Psytechnic
User Off Offline

Quote
leegao has written
Remember that the problem revolves around recursive growth.

I'll simplify it a bit:

There are currently 1,000,000 viruses within your body. The viruses grow 160% every 4 hours. At the same time, 50,000 viruses are eliminated. How long will it take for number of viruses to reach 10^12.

Hint: Try using a spreadsheet first.


Hmmm, one question, during the 4th hour change, does the 50,000 virii get removed before the Extra 60% is added on or after. The reason I ask is that it will give 2 different results if the order is changed.

Edit: Here's my script. I checked putting the removal of 50,000 before and after the addition of 60% and got the same result both times.

C# Program Code
Spoiler >

Hours = 120
I used Calc on scientific setting to work out 10^12... I'm lazy like that.

Also, in your 2.7.10 problem, there is a simple mathematical constant which suggests to users that the answer must be a factor of 4.

Quote
Problem 2.7.10

When viruses enter the somatic cells of a organism, they begin to rapidly replicate. In one particular instance, the number of viruses within an organism will double every four hours. Assuming that this is true for all cases, if 10,000 viral particles infect an organism, how long will it take for the number of viral particles to reach 1,000,000,000,000 (10^12)?

This means, the virus count only doubles every 4th hour, meaning the check for (!(virusCount < 10^12)) will only return true on a 4th hour, which means the answer has to be either 108 hours if you don't include the initial "0 hour" or 104 if you do. The logarithmic answer that you gave calculates the exact hour at which virusCount goes > 10^12, provided the growth is logarithmic and not uniform. The same result cannot be achieved by setting virus growthto increase by 25% every hour. If you were to do that, the answer would appear to be Hours = 83...

My Code for that problem:
Spoiler >
edited 3×, last 10.02.10 03:22:05 am
To the start Previous 1 2 3 Next To the start
Log in to replyOff Topic overviewForums overview