USING MATLAB
Where indicated in the script below, write a function, called
myflip, which accepts one vector v (either a column or a row) and
outputs the same vector v of the same dimensions, but with the
values in reverse order (use MATLAB function flip()). In other
words, v will be overwritten by its flipped version. In your
function, you may only use length() and floor(). You only need one
loop.
%this code tests the function, myflip, which you will write below
v1 = 100*rand(1);
v1 = myflip(v1)
n = randi([2 100], 1, 1);
v2 = 100*rand(1,2*n);
v2 = myflip(v2)
n = randi([2 100], 1, 1);
v3 = 100*rand(2*n+1,1);
v3 = myflip(v3)
In: Computer Science
IV. Answer parts A,B, and C
4a)
Return true if the letter 'a' occurs in the given String, and false otherwise.
containsA("abc") → true
containsA("wxyz") → false
containsA("bcaca") → true
4b)
Return true if the letter 'a' does not occur in the given String, and false otherwise.
notContainsA("abc") → false
notContainsA("wxyz") → true
notContainsA("bcaca") → false
4c)
Count the number of times a given char occurs in a given range of a String parameter (i.e. starting at a given start index, and up to but not including and end index). If end is greater than the length of the String, then the method should stop looking at the end of the String.
countCharsInRange("java", "v", 1, 2) → 0
countCharsInRange("java", "v", 0, 2) → 0
countCharsInRange("java", "v", 0, 3) → 1
In: Computer Science
R-Studio (R Programming Language)
1. How would you create a vector `V` containing the values 0,
0.25, 0.5, 0.75, and 1?
```{r}
#insert your code
```
2. Name the elements of `V`: first, second, middle, fourth, last.
Describe two ways of naming elements in `V`
```{r}
#insert your code
```
3. Suppose you keep track of your mileage each time you fill up.
At your last 6 fill-ups the mileage was
65311 65624 65908 66219 66499 66821 67145 67447. Enter these
numbers into R as vector `miles`. Use the function `diff` on the
data `miles`. What does it give? Use `sum` on the computed
differences to find the total travelled distance.
```{r}
#insert your code
```
In: Computer Science
As you know the corona vires has cause a massive decline (shift to the left) in the aggregate demand curve. Remember that the GDP is equal to consumption (C), gross investment (I), government expenditures (G) and net exports (Imports minus Exports or Ex) and this spending GDP is equal to the Price times the Quantity of all final goods and services (P * Q = Y) and also equal to the money supply times the velocity of circulation (M * V = Y). So the full formula is listed below:
aggregate demand money and spending
C + I + G + Ex = P * Q = M * V
According to the text per chapter 15 the main argument between the Monetarist and the Keynesians is the velocity of money (V). Is it stable or unstable. Three questions for you to answer:
1. The Federal Reserve Bank has been increasing (decreasing) the money supply. Why?
2. If as the Monetarist believe, V is stable, what would happen to prices (P)?
3. Since the consumer price index (CPI) has fallen over the last two months, what must have happened to aggregate demand or Q?
In: Economics
Orange 590(Peak Wavelength, nm)--- Photocurrent, mA (Current with zero stopping voltage)please anwers?--- Stopping voltage, V (Voltage to force current to zero)please anwers?
Green 530(Peak Wavelength, nm) ---
Photocurrent, mA (Current with zero stopping voltage)please
anwers?--- Stopping voltage, V (Voltage to force current
to zero)please anwers?
Blue 485(Peak Wavelength,
nm) --- Photocurrent, mA (Current with zero stopping
voltage)please anwers?--- Stopping voltage, V
(Voltage to force current to zero)please anwers?
Ultraviolet 445(Peak Wavelength, nm) ---
Photocurrent, mA (Current with zero stopping voltage)please
anwers?--- Stopping voltage, V (Voltage to force current
to zero)please anwers?
2/ Based on the graph with the best fit straight line, what can you say about the relationship betweenthe color (or frequency) of light and the energy of its separate bits or photons?
3/ Your value of Planck’s constant (h) from the Grapher: ( ? ) J-s
The accepted value of Planck’s constant from Google: ( ? ) J-s
Percent difference of your value from the accepted value: ( ? ) %
In: Physics
energy and power of signals.
(a) Plot the signal x(t) = e−tu(t) and determine its energy. What is the power of x(t)?
(b) How does the energy of z(t) = e−∣t∣, −∞ < t < ∞, compare to the energy of z1(t) = e−tu(t)? Carefully plot the two signals.
(c) Consider the
signal
y(t)
=
sign[xi(t)]
=
1
xi(t)
≥
0
−1 xi(t) < 0
for −∞ < t < ∞,i = 1,2. Find the energy and the power of y(t) when (a)x1(t) = cos(2πt) (b)x2(t) = sin(2πt)
Plot y(t) in each case.
(d) Given v(t) = cos(t) + cos(2t).
i.
Compute the
power of v(t).
ii.
Determine the
power of each of the components of v(t),
add
them and compare the result to the power of v(t).
(e) Find the power of s(t) = cos(2πt) and of f(t) = s(t)u(t). How do
they compare?
Answers: (a) Ex = 0.5; (b) Ez = 2Ez1; (c) Py = 1; (d) Pv = 1.
In: Electrical Engineering
An incandescent light bulb uses a coiled filament of tungsten that is 580 mm long with a diameter of 46.0 μm. At 20.0∘C tungsten has a resistivity of 5.25×10−8Ω⋅m. Its temperature coefficient of resistivity is 0.0045 (C∘)−1, and this remains accurate even at high temperatures. The temperature of the filament increases linearly with current, from 20∘C when no current flows to 2520∘C at 1.00 A of current. What is the resistance of the light bulb at 20∘C? What is the current through the light bulb when the potential difference across its terminals is 120 V? (Hint: First determine the temperature as a function of the current; then use this to determine the resistance as a function of the current. Substitute this result into the equation V=IR and solve for the current I.) Express your answer to two significant figures and include the appropriate units. What is the resistance when the potential is 120 V? Express your answer to two significant figures and include the appropriate units. How much energy does the light bulb dissipate in 1 min when 120 V is supplied across its terminals? Express your answer in kilojoules to two significant figures.
In: Physics
1. An AC power supply is in series with a 30 μF capacitor and a parallel structure with a 100 Ω resistor and a 300 mH inductor. The power supply produces electricity at frequency of 60 cycles / second with an RMS voltage of 120.0 V. a) What is the formula (including appropriate units) for function of the voltage of the power supply (w.r.t. time when time is in seconds) assuming the voltage was started at its maximum positive value? b) Draw the full phasor diagram when the resistance voltage phasor is at π/6 . Include identifying angles for the 8 phasors ( ε0,V R ,V C ,V L ,I P ,I R ,I C ,I L ). c) What are the equations for the voltages across and currents into each component? (There are 8 equations in all.) d) Assume the voltage from the power supply starts at its maximum positive value, what is first time when resistance voltage phasor is at π/6 ? e) At that moment in part (d), what are the instantaneous voltages across each of the four components, and what are the instantaneous currents into each of the four components?
In: Physics
Determine the Vmax and the Km of the enzyme in the absence and presence of each inhibitor. Calculate the KI for each inhibitor. Are the inhibitors all the same? Which is the best inhibitor and why? What is the catalytic efficiency and turnover number of the enzyme knowing that during the experiments its concentration was 2 nM? What happens to the catalytic efficiency and turnover number of the enzyme in the presence of each of the inhibitor?
The following velocity data were obtained for an enzymatic reaction in the absence and presence of three different inhibitors (A, B, and C):
Initial velocity (v) Initial velocity (v) Initial velocity (v) Initial Velocity (v)
[S] Control (no inhibitor) (+A at 6μM) (+B at 30μM) (+C at 4mM)
(mM) (nM/min) (nM/min) (nM/min) (nM/min)
0.200 16.67 6.25 5.56 10.00
0.250 20.00 7.69 6.67 11.11
0.333 24.98 10.00 8.33 12.50
0.500 33.33 14.29 11.11 14.29
1.00 50.00 25.00 16.67 16.67
2.00 66.67 40.00 22.22 18.18
2.50 71.40 45.45 23.81 18.52
3.33 76.92 52.63 25.64 18.87
4.00 80.00 57.14 26.67 19.00
5.00 83.33 62.50 27.77 19.23
In: Chemistry
1. Suppose 50.00 mL of 2.0 × 10–4 M Fe(NO3)3 is added
to 50.00 mL of 2.0 ×10-6 M KIO3. Which of the following
statements is true? For Fe(IO3)3, Ksp = 1.0 ×
10–14.
A) A precipitate forms because Qc >
Ksp.
B) A precipitate forms because Qc <
Ksp.
C) No precipitate forms because Qc < Ksp.
D) No precipitate forms because Qc = Ksp.
E) No precipitate forms because Qc > Ksp.
2. For which of the following reactions is ∆S° > 0 at 25°C?
A) 2H2(g) + O2(g) → 2H2O(g)
B) 2ClBr(g) → Cl2(g) + Br2(g)
C) I2(g) → I2(s)
D) 2NO(g) + O2(g) → 2NO2(g)
E) NH4HS(s) → NH3(g) + H2S(g
3. What is E of the following cell reaction at 25°C? Cu(s) | Cu2+(0.017 M) || Ag(s), (Ag+ = 0.18M)
E°cell = 0.460 V.
A) 0.468V
B) 0.282 V
C) 0.460 V
D) 0.490 V
E) 0.479V
In: Chemistry