Questions
In this assignment, we will build custom functions in R. As an example, the following function...

In this assignment, we will build custom functions in R. As an example, the following function called addPercent converts a value into a percentage with one decimal place.

addPercent - function(x){
percent - round(x*100, digits = 1)
result - paste(percent, "%", sep = "")
return(result)
}

Below are a few output results from this function.

addPercent(.1)
[1] "10%"
addPercent(10)
[1] "1000%"
addPercent(10.1)
[1] "1010%"
addPercent(0.1443)
[1] "14.4%"

  1. Write a custom R function that inputs a temperature in Fahrenheit Fo and converts to Celsius Co. The relationship is Co = 5(Fo - 32)/9.
  2. Write a custom R function that computes the sum of squares of two numbers.
  3. Write a custom R function that takes any univariate dataset and calculates the mean, minimum, maximum, and standard deviation.
  4. In statistics, a dataset needs to be transformed in order to meet certain assumptions. Write a custom R function that takes any univariate dataset and creates a histogram of the raw dataset and a histogram of the log-transformed dataset.
  5. Write a custom R function of your own. Describe what your function does and produce the output.

Using a Word document, include your functions along with least four different output results from each of the functions 1 through 5. Provide screenshots of the output results in a Word document that shows the current date.

In: Computer Science

question 3.1 a)   Briefly explain how a decrease in housing prices would affect consumption and investment....

question 3.1
a)   Briefly explain how a decrease in housing prices would affect consumption and investment. You may assume that consumers would like to maintain their target wealth. (word limit: max 100 words)


You answer.

b)   Given your answer to a), what is likely to happen to GDP? Explain using a diagram.

You answer.

c)   Given your answer to b), how can the government use fiscal policy to prevent GDP from changing? Use a diagram in your explanation.

You answer.

d)   If the marginal propensity to import is large, what can be said about effectiveness of fiscal policy? (2 mark)

You answer.


question 3.2
Country X has run budget deficit for the past twenty years and its government debt stands at 120% of GDP. Due to pandemic of COVID-19 the government considers implementing big investment in infrastructure and effective decrease in taxes. Expert 1 says that the debt to GDP ratio is too high and the country cannot afford increasing it any further. Expert 1 suggests printing money instead to finance budget deficit arguing that it would be cheaper and more efficient way of financing budget deficit. You are hired as Expert 2. Would you agree with Expert 1? Explain. What would be your advice to the government? (word limit: max 200 words).

You answer.

In: Economics

Write the simplest program possible in your language of choice containing your 'main' and any other...

Write the simplest program possible in your language of choice containing your 'main' and any other functions you may need that will:

A. Read a sequence of words up to a maximum of 64 words from std input. Before reading the input, prompt the user to enter the words.

B. Check to see if there any duplicate words in the input read.

C. If there are no duplicates, print out to std output the message 'No Duplicates'.

D. If there are duplicates, print out on separate lines each word that is duplicated and the number of instances of that word. The results should be sorted in ascending

E. If you write helper functions to your main, ensure that all input and output happens only in main.

F. Do not use Vectors, Collections, or any other data structures provided by the language platform or any oft-used third party libraries like STL.

G. Take screenshot of your program execution with the following samples.

H. Your program will be tested with my own input.

Sample Inputs Sample Outputs
THE RAIN IN MAINE. No Duplicates
THE RAIN IN MAINE IN THE MONTH OF MAY.

IN 2

THE 2

The rain in Maine in the month of May. in 2
The rain in Maine in the month of May makes May the rainiest month for Maine in the year.

Maine 2

May 2

in 3

month 2

the 3

Please do it in Python

In: Computer Science

For this activity, you will use a top-down approach to create part of a specification for...

For this activity, you will use a top-down approach to create part of a specification for development of a video game. The game can be any genre or theme that you’d like, but for this exercise, you should choose a single platform (smartphones, iPads, PS4, PC, etc.).

Your “roadmap” should cover the following elements:

Cover the specifications for the software needs and requirements of the project, presented in a top-down approach (starting with the “big picture” and breaking down from there into the smaller requirements). Remember that not all software needs are programming related. For each need or requirement, propose a software solution. You don’t have to specify the exact program you would use (for example, you could say “word processor” instead of “Microsoft Word”).
You may use any requirement tracking technique or tool you like in building the requirements list. One program, platform, application, or piece of software can meet many different needs.
In a separate section, you should describe how you will apply prototyping techniques and analysis tools to improve the final product. Again, this discussion should consider what, if any, tools you will need to implement prototyping.
You can structure the specification however you think best, as long as it maintains a top-down perspective. Suggested formats include a flowchart style or a tiered outline.
You can refer to online resources or independent research for this activity.

In: Computer Science

Working in teams has become necessary in many organizations and school projects. In this class, you...

Working in teams has become necessary in many organizations and school projects. In this class, you have also been allocated to project teams. Together with your teammates, you have accomplished two team projects. Reflect upon your experiences of the learning journey, drawing connections between Organizational Behavior theories and your team processes, and discuss accordingly. In particular:

a) What did your team do well? Identify your team’s top two key success factors and explain what interventions or unintended actions contributed to those positive experiences. (Discuss and Elaborate more with Individual Differences, Groups & Teams - 5 Stages of Team Development, Diversity & Inclusion, Leadership, Organisational Behavior, Management and other related topics.) (Word limit of 300 words)

b) What went wrong at certain points? What were the reasons behind the process losses in your team? Discuss up to two issues and explain how your team turned around these situations. (Discuss and Elaborate more with Individual Differences, Groups & Teams - 5 Stages of Team Development, Diversity & Inclusion, Leadership, Organisational Behavior, Management and other related topics.) (Word limit of 300 words)

*PLEASE TYPE YOUR ANSWER (NO SCREENSHOTS OR IMAGES) IN FULL SENTENCE/PARAGRAPH/REPORT FORMAT, NO POINT FORM. THANK YOU IN ADVANCE

In: Operations Management

Write a method named minimumValue, which returns the smallest value in an array that is passed...

Write a method named minimumValue, which returns the smallest value in an array that is passed (in) as an argument. The method must use Recursion to find the smallest value. Demonstrate the method in a full program, which does not have to be too long regarding the entire code (i.e. program). Write (paste) the Java code in this word file (.docx) that is provided. (You can use additional pages if needed, and make sure your name is on every page in this word doc.) Use the following array to test the method: int[] series array = {-5, -10, +1999, +99, +100, +3, 0, +9, +300, -200, +1, -300} Make sure that the series array only tests for values, which are positive, given your recursive method.

Part II (25 points) Algorithmic Performance as you are aware, consists (mainly) of 2 dimensions: Time and Space. From a technical perspective, discuss the following:  Regarding runtime, discuss algorithmic performance with respect to its runtime performance. As you develop an algorithm, what must you also consider in terms of some of the trade-offs? How would you go about estimating the time required for an algorithm’s efficiency (i.e. time to complete in terms of its potential complexity)? What techniques can you use? Give an example of how to measure it.

In: Computer Science

Choose 3 journal articles you think will be useful as references for your formal lab report...

Choose 3 journal articles you think will be useful as references for your formal lab report paper. You may use review articles or research articles. You might try typing in a keyword for your topic and the word “review”.   Obtain copies either from the library or from an on-line resource. In the space provided below, explain in no more than 5 sentences per article why you feel the article you have selected is appropriate for your paper. Just because your key word appears in the title does not automatically mean the paper will be useful for your report. Briefly state how you will use it in your report. Attach a copy of each article to the assignment before handing it in. Directions on how to access electronic journals through the University of Houston Library are at the end of this document. If you cannot download an article you desire directly from the PubMed website, try through the University of Houston Library electronic journals collection. If the university does not have the electronic version on file, you will have to go to the library and copy it on a copy machine (the old-fashioned way). If you cannot obtain a copy of the article, you can place a request through interlibrary loan at the service desk at the library or you will need to find another article.

in Crystallography

you can chose any subject you want :)

In: Chemistry

(I am a beginner in programming, can you give me answers that I can understand? I...

(I am a beginner in programming, can you give me answers that I can understand? I got some answers which I think are for high level. Thank you)

Q1.   Program Description: The program should:

Ask a user to enter some digit (integer) between 1 and 9

Multiply it by 9

Write the output to the screen

Multiply that new number by 12345679 (note the absence of the number 8)

Write that output to the screen.

As shown below, the program should print out the entire multiplication as though you had done it by hand.

Presents the output of two different input other than 5 in the Word doc.

-------------------Sample Screen Output:----------------------

Enter a number from 1 to 9: 5

5

X 9

----------------

45

X          12345679

---------------------

555555555   (ßTo look like this, the last number must be an int.)

Note: Your alignment does not need to be perfect, but should roughly approximate what you see above.

---------------------------------------------------------------------

Q2. Program Description: Write a program that prompts the reader for two integers and then prints:

The sum

The difference (This should be number1 minus number2.)

The product

The average (This should be a double number. with decimal point)

Presents the output of two different input sets in the Word doc.

--------------Sample Screen Output:------------------

Enter number 1:   13

Enter number 2:   20

Original numbers are 13 and 20.

Sum =             33

Difference =      -7

Product =         260

Average =         16.5

In: Computer Science

Objectives Determine a budget for personal consumption Explain the correlation between marginal utility and consumer's demand...

Objectives

  • Determine a budget for personal consumption
  • Explain the correlation between marginal utility and consumer's demand curve
  • Apply marginal utility theory to the paradox of value

Assignment Overview - In this assignment, you will construct a budget line for your spending habits and analyze the marginal utility of items.

Deliverables - A one-page (250-word) document

Step 1 Answer questions on your spending habits.

In a one-page (250-word) document, answer the following questions:

What kinds of things do you buy on a daily or weekly basis?

How much do these things cost?

Do the prices fluctuate, or are the prices usually stable (inelastic)?

Think about your spending habits in preparation for creating a budget line.

Step 2 Graph a budget line.

In the same document, use the information gathered in Step 1 to construct a budget line:

Choose two items that you use on a daily basis and purchase frequently.

Compare the quantities of each based on how much you can reasonably afford them by using a budget line.

Use the following as a guide in developing your graph:

Using (free) online graphing software such as shapes in Microsoft Word or other software create a graph.

Follow the instructions on the website to learn how to create and manipulate the graph(s).

Save the graph(s) to your computer as a jpeg or .doc file.

If not in .doc format, copy and paste the jpeg into the assignment document that you deliver to your instructor.

Step 3 Analyze the marginal utility.

In the same document, analyze the marginal utility using the items and information from Step 2:

Analyze the marginal utility of the two items when the quantity of these products increases as they become your possessions.

Then choose a third item that you truly cannot live without. Assess the marginal utility of this item until you reach the point where there is no utility (marginal utility = 0).

What is the correlation between marginal utility and your demand curve?

How does marginal utility apply to the paradox of value?

Include your reaction and response to how constructing the budget line and marginal utility analysis makes you feel about the three items you consume on a frequent basis.

In: Economics

# Let me define the function I use for testing.  Don't change this cell. def check_equal(x, y,...

# Let me define the function I use for testing.  Don't change this cell.

def check_equal(x, y, msg=None):

    if x == y:

        if msg is None:

            print("Success")

        else:

            print(msg, ": Success")

    else:

        if msg is None:

            print("Error:")

        else:

            print("Error in", msg, ":")

        print("    Your answer was:", x)

        print("    Correct answer: ", y)

    assert x == y, "%r and %r are different" % (x, y)

## Problem 1: common word pairs

The goal is to find the set of consecutive word pairs in common between two sentences.

We will get there in steps, guiding you to the solution.

# First, notice that .split() splits a sentence according to white space, returning a list.

print("I love eating bananas".split())

# Second, recall that in Python, a[i:k] gives you the sub-list of a consisting

# of a[i], a[i+1], ..., a[k-1].

a = "I love eating bananas".split()

print(a[2:4])

### Problem 1 part 1: generating the list of consecutive words in a sentence.

You are given a sentence, with words separated by white space. You need to write a function `word_pairs` that outputs the list of consecutive words. For example, if the input is:

"I love eating bananas"
  
Then the function `word_pairs` should output:

[("I", "love"), ("love", "eating"), ("eating", "bananas")]
  
If the input sentence consists of fewer than two words, then `word_pairs` should output the empty list.
**Be careful:** the result should be a list of tuples, not a list of lists.

def word_pairs(sentence):

    # YOUR CODE HERE

# Base cases.  5 points.

check_equal(word_pairs(" "), [])

check_equal(word_pairs("woohoo"), [])

check_equal(word_pairs("I am"), [("I", "am")])

def common_word_pairs(sentence1, sentence2):

    """Returns the set of common consecutive word pairs in two sentences."""

    # YOUR CODE HERE

s1 = "I love bananas"

s2 = "I love to eat bananas"

s3 = "Nobody truly dislikes to eat bananas"

s4 = "I love to eat anything but bananas"

s5 = "I like mangos more than bananas"

check_equal(common_word_pairs(s1, s2), {("I", "love")})

check_equal(common_word_pairs(s2, s3), {("to", "eat"), ("eat", "bananas")})

check_equal(common_word_pairs(s3, s4), {("to", "eat")})

check_equal(common_word_pairs(s1, s5), set())

In: Computer Science