Question

In: Computer Science

Please solve all parts of the following question on MATLAB. 1. Penn State football travels to...

Please solve all parts of the following question on MATLAB.

1. Penn State football travels to Ohio State to play the Buckeyes on Nov 23, 2019. The official capacity of Ohio Stadium is 104,944. Let’s say that the stadium is filled at the beginning of the game, but every time Penn State scores a touchdown half of the fans leave. How many touchdowns does Penn State have to score until there is just one fan left in the stadium?

a. construct a two-column matrix in which one column is number of touchdowns and the other column is number of people in the stadium.

b. plot touchdown number vs. number of fans on linear axes. The satisfactory plot will include: a title, and labeled axes. Since you are plotting discrete data points, please plot them with a symbol and connect the symbols with a line. All fonts should be large enough to be legible. You may choose the aspect ratio of your plot and what kind of symbol and line style to use.

c. redo the plot, but this time with a logarithmic y axis.

Solutions

Expert Solution

clear
clc
fans=104944;
i=1;
touchdowns=0;
mat=[touchdowns,fans];
while mat(i,2)~=1
touchdowns=touchdowns+1;
mat=[mat;touchdowns,floor(mat(i,2)/2)];
i=i+1;
end
fprintf('Number of touchdowns scored: %d\n',mat(end,1))
plot(mat(:,1),mat(:,2),'-o')
xlabel('Touchdowns')
ylabel('Number of fans')
title('touchdown number vs. number of fans')
figure
semilogy(mat(:,1),mat(:,2),'-o')
xlabel('Touchdowns')
ylabel('Number of fans')
title('touchdown number vs. log(number of fans)')


Related Solutions

This Question has 6 parts a) to f): Answer all of them below: Penn State Marketing...
This Question has 6 parts a) to f): Answer all of them below: Penn State Marketing and Branding Office is interested in understanding more about alumni’s donation behavior, and the director Tom invited you to analyze a data set of 1,000 donors in the year 2016. There are several variables in the data Yi Amount of donations in dollars donor i made in the year 2016. MCi: The cost of all marketing communications in dollars donor i received in the...
Please solve all parts of the following question. Please show all work and all steps. 1a.)...
Please solve all parts of the following question. Please show all work and all steps. 1a.) Solve x' = x + 3y + 2t y' = x - y + t^2 1b.) Solve x' + ty = -1 y' + x' = 2 1c.) Solve x' + y = 3t y' - tx' = 0
Please answer all the parts of this question Please answer all the parts of this question...
Please answer all the parts of this question Please answer all the parts of this question Question: a) Where is the flow accelerating in the control volume? b) Will the pressure be greater or less than hydrostatic in a region of accelerating flow? c) Is the hydrostatic estimate of force on the gate; larger, smaller, or the same, as that obtained from the Momentum Equation? Explain. d) Where does the change in flow momentum go in this control volume? Explain.
Please solve all parts Consider the following IVP y′ = 2t − y + 1, y(0)...
Please solve all parts Consider the following IVP y′ = 2t − y + 1, y(0) = 1. Find an approximation of y(1) using (a) the Euler’s method with N = 4, (b) the Euler’s method with N = 8, (c) the improved Euler’s method with N = 4, (d) the improved Euler’s method with N = 8. Solve the IVP, find y(1), and compare the accuracy |y(1)−yN | of the approximations.
Question 1 Problem 2.64 Use MATLAB to solve for and plot the response of the following...
Question 1 Problem 2.64 Use MATLAB to solve for and plot the response of the following models for 0≤t ≤1.5, where the input is f (t) =5t and the initial conditions are zero: 3¨ x +21˙ x +30x = f (t) A)  Use math (analytically) to find the response of the models given in Problem 2.64 of your book. Show all assumptions and all steps of your derivation. (Turn in the calculations.) B) Use MATLAB to solve the same problem 2.64...
Research question: In the population of all Penn State students, are more than 80% enrolled full-time?...
Research question: In the population of all Penn State students, are more than 80% enrolled full-time? In this question set you will be using StatKey to conduct randomization tests for a single proportion. These data are not built in to StatKey, so you will need to “Edit data” to enter in the sample counts. Please show screenshots and work. B. Using the five steps from the online notes, conduct a randomization test given that 350 students in a sample of...
define a matlab question and solve with matlab codes (rlc circuts)
define a matlab question and solve with matlab codes (rlc circuts)
I need the matlab codes for following question (1) (a). Solve the following second-order differential equations...
I need the matlab codes for following question (1) (a). Solve the following second-order differential equations by a pair of first-order equations, xyʹʹ − yʹ − 8x3y3 = 0; with initial conditions y = 0.5 and yʹ = −0.5 at x = 1. (b). Solve the problem in part (a) above using MATLAB built-in functions ode23 and ode45, within the range of 1 to 4, and compare with the exact solution of y = 1/(1 + x2) [Hint: ode23 à...
Question 1 Using MATLAB solve the following system of linear simultaneous equations 3x + 2y -...
Question 1 Using MATLAB solve the following system of linear simultaneous equations 3x + 2y - z = 10........... [1] -x + 3y + 2z = 5........... [2] x - y - z = -1 .................[3] s + 2t - 3u + 4v = 12........... [1] 2s + 2t - 2u + 3v = 10......... [2] t + u = -1............................ [3] s - t + u - 2v = -4................ [4]
Question 5. Use MATLAB to solve for and plot the response of the following models for...
Question 5. Use MATLAB to solve for and plot the response of the following models for 0≤t ≤1.5, where the input is f (t) =5t and the initial conditions are zero a. 3¨ x +21˙ x +30x = f (t) b. 5¨ A (Turn in the MATLAB script and answers from MATLAB, .m file, screen shots if needed) B (Turn in the MATLAB plot with t being time in SI units) C Comment on the response the analytical solution compared...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT