Skip to main content

US government’s discretionary budget

 5. Here is some data on the US government’s discretionary budget (things that are not mandatory, like Social security, Medicare, interest on the national debt) Source: https://www.thebalance.com/how-trump-amended-obama-budget-4128986. I have summarized it in a csv file (it’s possible that there are errors in the data, since I typed these all in manually, but this shouldn’t affect your analysis). You can use these commands to download the data and analyze it:

import pandas as pd import numpy as np df = pd.read_csv("https://raw.githubusercontent.com/mathalexchen/Data/main/budget.csv") print(df) year2019 = np.array(df["2019"]) # extract a particular column; convert to a numpy array department = np.array(df["Department"]) education = np.array(df.loc[1,:]) # extract a particular row:

# 0 for defense, 1 for education, etc.

Answer the following questions (you may also use a spreadsheet program instead of python, if you prefer–just go to the following link to get the data: https://raw. githubusercontent.com/mathalexchen/Data/main/budget.csv). Be sure to either share your code or write down the commands you used to generate your results.

a) Make a pie chart of the 2019 budget and label the slices of the pie accordingly.

b) Which government agency (of the ones listed) had their budget expe- rience the highest percentage growth from 2007 to 2019?

c) Is it safe to conclude from this data that Defense is where most discretionary spending goes? Note: I don’t think there’s a “correct” answer here; just make sure you present some analysis and justify it.

6. Given a list of numbers, print the ordered pair (a, b) such that the absolute value of the difference |a − b| is the largest. For example, if nums = [1, 5, 2, 9, -2], then print (9, -2) or (-2, 9), since these result in the largest absolute value of the difference —9 - (-2)— = 11.

7. (bonus question, 10 points) Suppose 1 out of 1000 people in the LA area are infected with Covid. Suppose also that there is a rapid test with the following properties:

– 90% of infected people test positive. – 99% of non-infected test negative.

If someone tests positive, what is the probability that this person has Covid? You may do this problem analytically or by simulation. If you write code, here are some tips:

2

• – Run many trials, probably 1,000,000. • – On each trial, simulate the probability that someone has Covid (a 0.001 proba-

bility).

• – Then if the person has Covid, simulate the probability that the person tests positive (0.9 probability).

• – If the person does not have Covid, simulate the probability that the person tests positive (1 - 0.99 = 0.01 probability).

• – Count the number of times that someone tested positive and has Covid; also count the number of times someone tested positive; dividing the former by the latter gives the probability you’re looking for.

• – You can ignore any times the test comes back negative


WE HAVE DONE THIS ASSIGNMENT BEFORE, WE CAN ALSO DO IT FOR YOU

GET SOLUTION FOR THIS ASSIGNMENT, Get Impressive Scores in Your Class

NO PLAGIARISM (100% Sure)

CLICK HERE TO MAKE YOUR ORDER on US government’s discretionary budget 

TO BE RE-WRITTEN FROM THE SCRATCH

Comments

Popular posts from this blog

Should pit bull terriers be banned in my community

 Discussion Forum: Counterarguments (Should pit bull terriers be banned in my community) You created a question about the topic for your W6 Rough Draft. For this discussion, you will give an answer to that question in the form of a thesis statement. "Dieting Makes People Fat" Main Post: Share your thesis statement with your classmates. Please note: As with last week’s discussion, nothing here is set in stone. Be open to changing everything about your topic, including your position and audience, as you research it and get feedback from your classmates. Topic + Position/Purpose + Supporting Points =Thesis Statement Example: Suppose the question you posed in the Week 5 discussion was something like, “Should pit bull terriers be banned in my community?” After doing some preliminary research, you have concluded that pit bulls, if raised properly, are no more dangerous than other breeds of dogs. Your thesis statement can be something like, “Pitbulls should not be banned

Controversy Associated With Dissociative Disorders

 Assignment: Controversy Associated With Dissociative Disorders The  DSM-5-TR  is a diagnostic tool. It has evolved over the decades, as have the classifications and criteria within its pages. It is used not just for diagnosis, however, but also for billing, access to services, and legal cases. Not all practitioners are in agreement with the content and structure of the  DSM-5-TR , and dissociative disorders are one such area. These disorders can be difficult to distinguish and diagnose. There is also controversy in the field over the legitimacy of certain dissociative disorders, such as dissociative identity disorder, which was formerly called multiple personality disorder. In this Assignment, you will examine the controversy surrounding dissociative disorders. You will also explore clinical, ethical, and legal considerations pertinent to working with patients with these disorders. Photo Credit: Getty Images/Wavebreak Media To Prepare · Review this week’s Learning

CYBER SECURITY and how it can impact today's healthcare system and the future

 Start by reading and following these instructions: Create your Assignment submission and be sure to cite your sources, use APA style as required, and check your spelling. Assignment: Recommendations Document Due Week 6 (100 pts) Main Assignment Recommendations Document The 1250 to 1500-word deliverable for this week is an initial draft of your recommendations. Note that this is a working document and may be modified based on insights gained in module eight and your professor's feedback. This document should contain the following elements: Summary of your problem or opportunity definition A list of possible recommendation alternatives. In this section, you are not yet at the point of suggesting the best set of recommendations but you are trying to be creative and explore all the different ways that the problem or opportunity might best be addressed. The end result here will be a list of alternatives among which you will choose your final recom