Question

In: Mechanical Engineering

The array price given below contains the price in dollars of a certain stock over 10 days

The array price given below contains the price in dollars of a certain stock over 10 days. Use MATLAB to determine how many days the price was above $20.

price = [19, 18, 22, 21, 25, 19, 17, 21, 27, 29]

Solutions

Expert Solution

We have been provided with an array that contains the prices for 10 days. We need to determine for how many days the array prices were above $20.

 

We can create a Boolean array which will contain 1 if the array price is greater than $20; otherwise it will contain 0. We can use the sum function to calculate the number.

 

The MATLAB code is given below:

Input:

x = [19,18,22,21,25,19,17,21,27,29];

array = x>20;

sum(array)

 

Output:

 

We find that on 6 days the price was greater than $20.


We find that on 6 days the price was greater than $20.

Related Solutions

1. Sales (in thousands of dollars) over 5 days at 4 different stores are recorded below....
1. Sales (in thousands of dollars) over 5 days at 4 different stores are recorded below. Store 1 Store 2 Store 3 Store 4 10 20 13 30 15 20 17 25 10 25 15 30 20 15 20 35 20 20 14 30 Test the claim that there is a significant difference among the mean amount of sales at the 4 stores, using α=0.05. Round you answer to 3 decimal places. Group of answer choices p-value=0.000, evidence support claim...
​Eagletron's current stock price is $10. Suppose that over the current​ year, the stock price will...
​Eagletron's current stock price is $10. Suppose that over the current​ year, the stock price will either increase by 95% or decrease by 45%. ​Also, the​ risk-free rate is 25 %25% ​(EAR). a. What is the value today of a​ one-year at-the-money European put option on Eagletron​ stock? b. What is the value today of a​ one-year European put option on Eagletron stock with a strike price of $ 19.50$19.50​? c. Suppose the put options in parts ​(a​) and ​(b​)...
Given: a stock price of $70; an exercise price of $70; 70 days until the expiration...
Given: a stock price of $70; an exercise price of $70; 70 days until the expiration of the option; a risk free interest rate of 6%; the annualized volatility of 0.3242. No dividends will be paid before option expires. Compute the value of the call option. Use the Black-Scholes Option Pricing Model for the following problem
​Eagletron's current stock price is $ 10 $10. Suppose that over the current​ year, the stock...
​Eagletron's current stock price is $ 10 $10. Suppose that over the current​ year, the stock price will either increase by 95 % 95% or decrease by 57 % 57%. ​Also, the​ risk-free rate is 25 % 25% ​(EAR). a. What is the value today of a​ one-year at-the-money European put option on Eagletron​ stock? b. What is the value today of a​ one-year European put option on Eagletron stock with a strike price of $ 19.50 $19.50​? c. Suppose...
The following table shows the average stock price, in dollars, of XYZ Corporation in the given...
The following table shows the average stock price, in dollars, of XYZ Corporation in the given month. Month Stock price January 2011 $43.73 February 2011 $44.23 March 2011 $44.42 April 2011 $45.21 May 2011 $45.92 (a) Find the equation of the regression line. (Let P be the stock price in dollars and t the time in months since January, 2011. Round the regression coefficients to three decimal places.) P(t) =
1. Given an array of integers a dimension n. If the array contains the same number...
1. Given an array of integers a dimension n. If the array contains the same number of even and odd elements get (a1 + an) (a2 + an-1) ... 2. Given an array of integers dimension n. All array elements with even numbers preceding the first element to the maximum, multiplied by the maximum. 3. Given an array of dimension n. Insert after each zero element of the element in the middle (or the amount of secondary elements for even...
The trade volume of a stock is the number of shares traded on a given day. The given data file contains the volume(in millions) of PepsiCo stock for a random sample of 40 trading days.
Volume (in millions) 2.37 2.42 3.25 3.94 4 4.02 4.13 4.16 4.28 4.35 4.41 4.42 4.64 4.8 4.84 4.92 4.95 4.97 4.98 5.04 5.05 5.07 5.32 5.55 6.1 6.16 6.22 6.23 6.39 6.67 6.69 6.71 6.92 6.96 7.28 7.29 7.54 7.56 7.71 8.88 The trade volume of a stock is the number of shares traded on a given day. The given data file contains the volume(in millions) of PepsiCo stock for a random sample of 40 trading days. (1) Use...
In the following, S0 is the stock price in dollars as of today, K is the...
In the following, S0 is the stock price in dollars as of today, K is the strike price in dollars, r is the continuously-compounded risk-free interest (as a decimal), q is the continuous dividend yield (as a decimal), sigma is the volatility (as a decimal) and T is the time to maturity in years. Compute option prices in dollars for the following types of options and the following parameter values with a three step binomial tree. A. S0 = 100,...
The daily returns for a stock over a period of 110 days are recorded, and the...
The daily returns for a stock over a period of 110 days are recorded, and the summary descriptive statistics are given as follows: Descriptive Statistics: return Variable N N* Mean SE Mean StDev Minimum Q1 Median Q3 Maximum Return 110 0 0.000983 .00296 .03103 -.19992 -.01393 .00322 .01591 .09771 a) Find a 95% confidence interval estimate for μ, where μ is the population mean rate of return of the stock. b) Test the hypothesis Ho:μ= 0 versus Ha:μ > 0...
The current price of one share of a certain stock is 100. The price of a...
The current price of one share of a certain stock is 100. The price of a one-year call option on the stock with a strike price of 105 is 10. The risk-free interest rate is 5.884% and the stock’s dividend yield is 2.02% Mr. John would like to create a synthetic long put option on the stock with a strike price of 105 and one year to maturity, using: Stock Call option Cash Determine the amount of cash and the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT