WRITE PYTHON CODE- SOME BASICS HAVE BEEN PROVIDED. KINDLY FILL IN THE NECCESSARY CODES Suppose an insurance company is i

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

WRITE PYTHON CODE- SOME BASICS HAVE BEEN PROVIDED. KINDLY FILL IN THE NECCESSARY CODES Suppose an insurance company is i

Post by answerhappygod »

WRITE PYTHON CODE-
SOME BASICS HAVE BEEN PROVIDED. KINDLY FILL IN THE NECCESSARY
CODES
Suppose an insurance company is insuring against burglary that
happens with probability 0.1. The customer's wealth will be 40,000
if his or her home was broken in, and 50,000 otherwise. The
insurance company pays 10,000 if a burglary happens, and 0
otherwise. The insurance policy costs 1,000. Simulate the average
payoff to the insurance company if it sells to 100, 1000, or 10000
customers. Plot the histogram on a figure.
CODES GIVEN ALREADY -
import numpy as np
import matplotlib.pyplot as plt
# number of possible customers
N1=100;
N2=1000;
N3=10000;
# number of experiments
n=500
"""Part (a) generate arrays of size (n,N1), (n,N2), (n,N3) filled with a random number drawn from uniform(0,1)
"""
""" Part (b) Using Boolean masks, find out indices for draws that are <0.1.
burglary1=
burglary2=
burglary3=
"""
rev1=np.ones((n,N1))*1000
rev2=np.ones((n,N2))*1000
rev3=np.ones((n,N3))*1000
rev1[burglary1]=-9000
rev2[burglary2]=-9000
rev3[burglary3]=-9000
""" Part (c) Find out the average payoffs for the insurance company when they sell to 100, 1000, and 10000 customers, repsecitvely.
You should end up with an average payoff for each experiment in the simulation.
That is, you will have three variables, avg1, avg2, avg3, each of size n-by-1
avg1=
avg2=
avg3=
"""
plt.hist(avg1,alpha=0.4,density=True)
plt.hist(avg2,alpha=0.4,density=True)
plt.hist(avg3,alpha=0.4,density=True)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply