Use Python or Matlab to produce the solution for the following problems. Calculate the probability that individual has at least two violations. Calculate the expected value and variance of number of violations.  Suppose an individual with X violations incurs a surcharge of $30X+$50. Calculate the expected amount of the surcharge, and the variance

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Use Python or Matlab to produce the solution for the following problems.

  • Calculate the probability that individual has at least two violations.
  • Calculate the expected value and variance of number of violations.
  •  Suppose an individual with X violations incurs a surcharge of $30X+$50. Calculate the expected amount of the surcharge, and the variance.
An individual who has automobile insurance from a certain company is
randomly selected. Let X be the number of moving violations for which the individual was
cited during the last 3 years. The probability mass function of X is given below
Number of moving
violations (X)
0
0.2
1
0.2
2
3
0.2 0.2
4
0.2
Transcribed Image Text:An individual who has automobile insurance from a certain company is randomly selected. Let X be the number of moving violations for which the individual was cited during the last 3 years. The probability mass function of X is given below Number of moving violations (X) 0 0.2 1 0.2 2 3 0.2 0.2 4 0.2
Expert Solution
Step 1: Providing the algorithm

1. Initialize the probabilities list with the given probabilities: [0.2, 0.2, 0.2, 0.2, 0.2].

2. Problem 1: Calculate the probability that the individual has at least two violations:
   - Set prob_at_least_two_violations as the sum of probabilities from index 2 to 4 (inclusive).
   - Output prob_at_least_two_violations.

3. Problem 2: Calculate the expected value and variance of the number of violations:
   - Set expected_value as the sum of (i * probabilities[i]) for each index i from 0 to 4.
   - Set variance as the sum of (((i - expected_value) ** 2) * probabilities[i]) for each index i from 0 to 4.
   - Output expected_value and variance.

4. Problem 3: Calculate the expected amount of the surcharge and the variance:
   - Set expected_surcharge as the sum of ((30 * i + 50) * probabilities[i]) for each index i from 0 to 4.
   - Set variance_surcharge as the sum of ((((30 * i + 50) - expected_surcharge) ** 2) * probabilities[i]) for each index i from 0 to 4.
   - Output expected_surcharge and variance_surcharge.

5. End.

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Time complexity
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education