Beta
Understanding epidemic.
Loading description...
Algorithms
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
New python test framework is required.
Python needs random tests. See this
Please use new python test framework.
raising as an issue.
I added a performance check. Let me know if it's a good idea, as numbers there are not realistic. On the other hand we may want to find parameters for the disaease and to do this we'll be running the model thousands of times. Maybe it's better to use possible values and just loop it?
I'm confused by your rounding.
In the fifth example case you have a multiplier of 2.5. Assuming this means each infected person infects 2.5 new people per day should we be using math.floor (2.5 yields 2), math.ceil(2.5 yields 2), or round (2.5 yields 2) to determine how many new incubating cases there are when there is 1 infecting person on day 4?
Just use round() function returning the results. How can I make it clearer?
I don't know. Should I be maintaining fractional people throughout the process? Or should I be rounding at each day? Because I feel like I should be rounding at each day since fractional people can't be infected. It's a binary state.
You definitely shoudn't round each day, although I can understand why you consider it. Generaly speaking for every single value here we take a mean for thousands of people. Doing it by looking at individuals we should look like this:
Anyway, there is an information that results must be rounded. Should I add any additional information?
You should add precisely what you told me - that fractional people are to be carried forward until the very end and only the returned results are to be rounded. That will inform solutions from the start instead of forcing a complete solution redesign.
Changed to: "In case multiplier is a fraction, round the result numbers only." Is it acceptable?
As there is no reply and I think it's clear now what to do if multiplier is not integer, I'm marking issue as resolved.
I'm confused by your multipler. In the instructions you say that a multiplier of 1 means that each infecting person infects one new person each day. But in the test cases you say that a multiplier of 2 means that each infecting person infects one new person each day. Which is it, and how is the multiplier intended to work?
Thank you for pointing it out. I changed the definition of multiplier and missed it in that comment. Fixed.
Hi,
there is still a lot to do about the description. You never clearly define the terms you use for your problem:
Needs more markdowns, as suggested below.
"pro tip": do never give the "task" before defining the critical terms in your sentence. Like "active infecting people" -> "wut!?" x)
(edit: sorry, but the more I dig, the more I feel like it's still a total mess ;o )
You're right. There are a lot of terms which should be defined better. As there are many informations, I decided to introduce them step by step. I'm thinking about creating a summary or introduction, just listing those terms. Is it a good idea? Any more suggestion?
I rearanged it a bit, can you take a look?
not sure yet... Seems stuff is still missing.
Like, in the first part, seems to me you're assuming that any people are "at contact" with any other people as long as they aren't confined. Tho, you give the first batch of data without having explained anything about that.
Defining stuff in the beginning sounds good, yes. Even better if you begin giving the general idea about the task first, without any specifics. "We are about to model... the model will take stuff into account..."
Finally, you never give a concrete section explaining either what the inputs look like, or what the actual output look like. => missing those two sections in the description, and an actual example.
To get first batch of data you only need incubation time and infection rate. Once again, can you take a look please?
na, not good enough: now there is a "multiplier" thing showing up in the input example that is never talked about anywhere. x/
the growth will look like this:...
are you absolutely sure you're talking about "growth" here? and not number of people? Because according to the following part, it seems to me you're actually talking about a number of people. No?Warning, there is a mistake you need to avoid: at that point, fixing the description by patching it here and there may just lead to more mess. Better to summarize what you need, and to reorganize the whole thing, rewritting the description from scratch.
For government and statistics people are not important. The focus is on growth (in case of epidemic exponential growth) :) Jokes aside, I'll change it.
"Finally, you never give a concrete section explaining either what the inputs look like, or what the actual output look like." I understood it as giving input and output. Can you explain it?
I need an hour or two without thinking about it, so I'll lose this description in my mind and I'll be able to create something new. Thank you for your contribution!
yes that's more or less the idea and what you did. You can make it more "concrete" using titles:
I wrote it from the beggining. I guess that means that new errors appear, but hopefully it'll be better this time.
The text is long, with a lot of data, what makes it boring and hard to read. I allowed myself to add some epidemic humor. Please let me know if it's not appropiate or delete/unpublish if I may get banned for it.
'begins to feel better, in there. ;) Still some things to tackle, tho.
On day 3 to 7 Robert is still infecting
-> you're talking here about the infecting time while you didn't give/explain it yet (it's given 2 lines below)Infecting time = 5, so Robert is spreading...
that part comes a bit "out of nowhere". I mean, the "Infecting time = 5". => You're discussing an example, so begin with providing the full set of inputs (-> at the line just after the "epidemiologist" thing) and then, that part will go smoothly.On day 3 to 7 Robert is still infecting
, so: days 2,3,4,5,6,7... That makes an infection time of 6 days, that, not 5. => new assumptions you're doing without telling, or a mistake somewhere?... with Anya, so she is incubating on day 3 and on day 4 she is infecting
-> prefere this version:... with Anya, so she is incubating on day 3 and she is infecting on day 4...
Sorry for the wall of text... XD
But as you can see, even if it's already far better, there are still a lot of things to handle yet. ;)
Cheers
Migrants != immigrants. Correct me if I'm wrong. It's not only foreign people, because for example in Poland most of infected people who arrived were Poles who spent winter break in Italy.
I changed "migrants" to "infected migrants", that's what I meant.
Everything here is an average. Incubation for COVID-19 can last from 2 to 14 days. People will infect shorter or longer. The beauty of this is that if we don't care about individuals, we can take some constant values and make the model much simpler.
"any people can infect any other people in the whole country". Yes, again to simplify things. The model still works for the very beggining of epidemic, like first 2 months. As I understand, you want to add SIR model together with containers (infection spreads faster in a container than between them). It's nice and something to think about, together with giving the number of confirmed cases and estimating infected people with incubating virus and more random values. My point was to make this task "as simple as possible" while still talking about incubation time and infecting time.
"active: you're considering that the contagioon is possible only for already sick people". Again, to simplify things. Actually it's something I could mention, but I'm not sure where... There are people who are not sick and they're spreading virus. In case of COVID-19 it's around 10%, who will never get sick and they are a huge problem if we try to just isolate people, without making tests.
Changed infecting time and recovery time description. Recovery time will be overlaping anyway, just the question is should it overlap the incubation time. I left it as it was.
About death rate, we can bother, but 10% while 90% of them are over 60 years old... This part is actually too realistic and I think it's the main reason why many governments didn't want to introduce heavy restrictions straight away. They don't bother.
Dogs are unrealistic, it's just a joke with some truth. Noone cares about animals during epidemic. To this day numbers are very small thanks to restrictions and high higiene standards, but if milions of people will be dying, then noone will talk about animals.
Anya description changed.
The most important one! I clearly made a mistake in script (I can't count to 5). I'll dig deeper to check other values. I don't know why it happened yet, so I'm unpublishing the task.
Thank you for wall of text, very useful :)
1)woops, I'm not english native, surely I'm wrong, here, yes.
3,4,5) that's not really my points. What I'm trying (and apparently failing) to say is that you perfectly can use those approximations, I see nothing wrong about that, but you have to be clear about those. Just be explicit ("we'll considere that, to simplify the problem")
let's see when you comes back from your draft section, so
Cheers.
Apparently the bug was stupid and doesn't affect other parts, so I published it again. Added a note.
One more question... It's my first kata, I would like to know how to make it interesting.
I noticed that even though the problem is interesting, it's hard to present it in interesting way. Plenty of text, many parameters are the biggest issue here - at least I think so. I though that for people who like algorhitms it's a nice task, but it seems I was wrong.
Could you give me a tip, the idea, how would you create a task about epidemic and exponential growth?
Hi
Here, you somehow enter the weird world of personal tastes. There is no real rules. Moreover, the feedback from the very same user can vary from one day to another...
Nothing more useful to say, sorry... :/
Ok, thank you.
Should I consider the problem as resolved, or come here in half a year and try to change it once again?
Let's close it for now. If I give it a try, one day, I'll reopen something if it still seems appropriate.
Publishing it yesterday was a big mistake, I rushed it. I am sorry for that. I improved description, changed some definitions so it's easier to undestand them. If you have any doubts or result is wrong (I could make a mistake as well), please let me know.
It's not clear how to handle rounding
Why are they rounding differently?
Description error. Fixed and improved. I also changed some definitions, so algorithm is a bit different now.
One big question. While writing a description sometimes "enter" moves to newline, sometimes not. For example, infection days in editor are in seperate rows, but in preview it's one line. How to fix that?
You need to read docs about markdown lang. CodeWars use a 'modified' version of it, also new lines are handled differently in kata desc and comment part. For simplification, you only need to know that
Thank you :)
Have you seen this kata? Looks almost the same: https://www.codewars.com/kata/5e9339dadf14380001c61fd1
Thank you for information. I actually thought about making a similar/the same task. This one is different, harder. What is more, his task is completely unrealistic. At least in my mind, my task is a good example how infection spreads at the very beggining of epidemic. Things to understand: people do not infect immediately, both infection rate and infecting time have a huge impact on numbers.