# Final project for CS8 – Summer 2020, Professor Jeff Moehlis (Prof J-Mo)
# Final project for CS8 - Summer 2020,Professor Jeff Moehlis (Prof J-Mo) # We've included some structure andcommands, and you'll need to fill # in the rest import random defsetParameter(paramStr,defaultValue):# Do not change this function '''This function takes as input a string paramStr and a float or int defaultValue. If paramStr isthe empty string, the function returns the value of defaultValue. If paramStr is not the empty string, the function returns the float or integer associated with the string, according to the type of defaultValue. param paramStr: a string param defaultValue: can be either a float or an int ''' if paramStr == "": return defaultValue else: if type(defaultValue) == int: return int(paramStr) else: return float(paramStr) defrunTrial(beta,kappa,S0,Z0,survivors):# You will need to fill in the codefor this function ''' This function simulates a single trial, where a trial is a simulation of the zombie model which starts with S0 susceptibles and Z_0 zombies, and proceeds until either the humans win (Z=0) or the zombies win (S=0). The inputparameters S0, Z0, beta, and kappa are model parameters. The inputparameter survivors is a list containing the number of human survivors for all trials so far for which there is a positive number. If the zombies win, the function returns the string "zombies". If the humans win, the function returns the string "humans" param beta: a float giving the rate of zombie infection param kappa: a float giving the rate at which zombies are killed param S0: an integer giving the initial number of humans param Z0: an integer giving the initial number of zombies param survivors: a list of integers containing the number of human survivors for all trials so far for which there is a positive number; note that this is mutable ''' # Dictionary which contains defaultvalues for the model parameters# Do not change this dictionarydefault = { "beta":0.01, "kappa":0.008, "S0":190, "Z0":10, "numtrials":100} # Main Program ans = input("Would you like touse the default values for model parameters? (y or n): ") if ans == 'y': # use default values for model parameters;# the values should be accessed fromthe dictionary called default beta = ... kappa = S0 = Z0 = numtrials = else: beta_str = input("Enter value for beta (Press return for beta ={}): " .format(default["beta"])) beta = setParameter(...) # thisneeds to be filled in # do similar commands to set thevalues for kappa, S0, Z0, and numtrials # Here you'll do numtrials simulationsof the zombie apocalypse, keeping# track of how many times the humanswin. Think of this as a Monte Carlo# simulation, as discussed in lecture. # calculate and print the percentchance that the humans win, in the# format given in the problemstatement # If appropriate according to theproblem statement, print# "Yikes!"# "Sorry, doesn't look good forthe humans!"# "It's a toss-up!"# or "Looks good for thehumans!" # If there was at least one trial forwhich at least one human survived, print# the average number of suvivors inthe format given in the problem statment
Try it now!
How it works?
Follow these simple steps to get your paper done
Place your order
Fill in the order form and provide all details of your assignment.
Proceed with the payment
Choose the payment system that suits you most.
Receive the final file
Once your paper is ready, we will email it to you.
Our Services
Ace Writing Center has stood as the world’s leading custom essay writing services providers. Once you enter all the details in the order form under the place order button, the rest is up to us.
Essays
At Ace Writing Center, Nowadays, students normally have extremely busy schedules. You will note that some of them have to take on some evening or weekend jobs in order to get some income that can help them to sustain in college or in the university. This can deny them a chance to write all the essays given. Others usually get bombarded with a lot of work by their lecturers. This can still delay such students from working on all their essays. However, some of them usually try to work on all these essays but end up delivering their work late. This can prevent them from graduating since most lecturers are strict on deadlines. If you want to write a business essay, the wise way is to hire an outstanding essay writing service like us, so that you can get the best results. If you are keen, you will note that many companies usually overcharge their customers. Some of them are there only to make money. And in reality, they really don’t care to build a long term commitment with students. You should not choose such companies. You should take your time and choose a reliable company to work with. Ace Writing Center is the ultimate solution for you. We have been offering our writing service for more than 7 years. This is a clear indication that you will get quality essay writing service. We have a wide range of writers who can work on any business essay that you might have. We believe in doing extensive research so that we can provide quality work to all our clients. .
Admissions
Admission and Business Papers
Have you ever had to write an admission essay for college? The majority of students face the same issues when applying to a university or college and many in such situations decide they need professional help to cope with this matter. They get in a situation when the deadline keeps coming closer but lack motivation to start because they are just not sure if their writing skills are strong enough. We have a solution for you! Ace Writing Center is the best admission essay writing service with a large professional team and years of experience in providing high-quality papers to students of all levels and faculties. The mission of our team is to help students make their dreams of entering a good college come true and that’s what we offer!.
Editing
Editing and Proofreading
Sometimes all the words for your paper just flow out of your mind and into your fingers. You type quickly at your keyboard and there they are, your beautiful words right there on the screen. But you have no idea how to polish it up. You may be wishing there was a paper writing service that offered this type of writing service. Look no more! Here at Ace Writing Center, we offer you an editing and proofreading option that you can't find anywhere else..
Coursework
College Essay Writing
In case you are familiar Ace Writing Center, you know the way to distinguish a better company from a cheap one exactly. First of all, poor service website does not have a sufficient support. We think support team is an essential part of success; it has to answer all clients’ questions and be a connecting link between clients and their writers. On our web-service you will get answers about anything you need and your writer will receive all your instructions, assignments and requirements exactly and swiftly. A writing service that we run has got a flexible pricing system that will save you from senseless wastes and many bonus systems that let you sparing money for something important for you.