Question 1
The GCD is the greatest common denominator. Euclid found that if A=Bx +R then GCD(A,B)=GCD(A,R). Prove this is true. Show working
Question 2
The approach Euclid in calculating the GCD used was novel as it was an ________process to solve a complex problem, hence formed the first _______.
Question 3
The difference between a breadth first search (BFS) and a depth first search (DFS) is that in the DFS you traverse all the first branch before proceeding to the next branch.
a) True
b) False
The first definition as graphs need axes
The second definition as more general so covers all graphs
Neither as they are too vague
Question 5
Find a c such that f(n) is O(n2) when f(n) = 1/4 n2 + 15 n + 115. Justify this answer.
Question 6
If f(n)= 10* log n then Big-O of f(n) is O(n)
a) True
b) False
In: Computer Science
Suppose we are given an arbitrary digraph G = (V, E) that may or may not be a DAG. Modify the topological ordering algorithm so that given an input G, it outputs one of the two things:
a. A topological ordering thus establishing that G is a DAG.
b. A cycle in G thus establishing that it is not a DAG.
The runtime of your algorithm should be O(m+n) where m = |E| and n = |V|
In: Computer Science
Which of the following statements is (are) correct?
(x) A choice by Molly to buy more muffins at $2 per muffin than at
the price of $3 per muffin is an example of
the law of demand and it is illustrated as a movement along Molly’s
demand curve for muffins.
(y) A choice by Albert to buy more Tony’s pizza because of a recent
increase in the price of Polly’s pizza is
illustrated as a shift to the right of Albert’s demand curve for
Tony’s pizza and reflects an increase in
demand for Tony’s pizza.
(z) If George has a change in behavior and is now willing to buy
less apple pie at every price, then his
demand curve for apple pie will shift to the left.
A. (x), (y) and (z)
B. (x) and (y) only
C. (x) and (z) only
D. (y) and (z) only
E. (y) only
Which of the following statements is (are) correct?
(x) Assume pizza and soda are complements. If the price of pizza
decreases, then both the demand for soda
will increase and the demand curve for pizza will shift to the
right.
(y) Assume Lipton green tea and Arizona green tea are close
substitutes. If the price of Lipton tea decreases,
then the quantity demanded of Lipton tea will increase and the
demand for Arizona tea will decrease.
(z) Assume Hershey chocolate bars and Mars chocolate bars are
substitutes. If the price of Hershey chocolate
bars decreases, then the demand curve for Mars chocolate bars will
shift to the left.
A. (x), (y) and (z)
B. (x) and (y) only
C. (x) and (z) only
D. (y) and (z) only
E. (y) only
Which of the following is NOT a determinant of demand?
A. the expected price of the good next month
B. the price of a resource that is used to produce the good
C. the price of a complementary good
D. the price of a substitute good
E. A and B, only
In: Economics
R PROGRAMMING QUESTION
- Below I have code. For each double hashtag (##) can you comment on the code below it (Describe what is happening in the code below it next to each ##)
- Run the code and compare the confidence intervals
- I have to submit the confidence intervals, comments, and the code with the ## filled out
Leaps.then.press.plot.2<-function(xmat0,yvec,xpred,ncheck=20)
{
#
#input quadratic matrix with less than 30 columns eg. the result of x.auto2a<-matrix.2ndorder.make(xmat[,-7],F)
#also, no need for plotting, just pull out best, xpred is one of the row vectors from x.auto2a, but all terms with weight are divided by 2
#
##
leaps.str<-leaps(xmat,yvec)
##
z1<-leaps.str$Cp-leaps.str$size
##
o1<-order(z1)
matwhich<-(leaps.str$which[o1,])[1:ncheck,]
MPSEvec<-NULL
##
for(i in 1:ncheck){
ls.str0<-regpluspress(xmat[,matwhich[i,]],yvec)
##
parvec<-matwhich[i,]
npar<-sum(parvec)
## (WHY npar+1)
MPSE<-ls.str0$press/(length(yvec)-(npar+1))
MPSEvec<-c(MPSEvec,MPSE)
}
##
I1<-(MPSEvec==min(MPSEvec))
##
i<-c(1:ncheck)[I1]
##
xmat.out<-xmat[,matwhich[i,]]
##
xpred.out<-xpred[matwhich[i,]]
##
list(xmatout=xmat.out,yvec=yvec,xpredout=xpred.out)
}
Bootreg<-function(xmat,yvec,xpred,nboot=10000,alpha=0.05)
{
##
lstr0<-leaps.then.press.plot2(xmat,yvec,xpred)
xmat0<-lstr0$xmat.out
yvec0<-lstr0$yvec
xpred0<-lsstr0$xpredout
##
rprd.list<-regpred(xpred0,xmat0,yvec0)
ypred0<-rprd.list$pred
sdpred0<-rprd.list$sd
df<-rprd.list$df
##
bootvec<-NULL
nobs<-length(yvec0)
for(i in 1:nboot){
##
vboot<-sample(c(1:nobs),replace=T)
xmatb<-xmat0[vboot,]
yvecb<-yvec0[vboot]
##
lstrb<-leaps.then.press.plot2(xmatb,yvecb,xpred)
##
xmatb0<-lstrb$xmat.out
yvecb0<-lstrb$yvec
xpredb0<-lsstrb$xpredout
##
rprd.list<-regpred(xpred0,xmat0,yvec0)
ypredb<-rprd.list$pred
sdpredb<-rprd.list$sd
dfb<-rprd.list$df
##
bootvec<-c(bootvec,(ypredb-ypred0)/sdpredb)
}
##
lq<-quantile(bootvec,alpha/2)
uq<-quantile(bootvec,1-alpha/2)
##
LB<-ypred0-(sdpred0)*uq
UB<-ypred0-(sdpred0)*lq
##
NLB<-ypred0-(sdpred0)*qt(1-alpha/2,df0)
NUB<-ypred0+(sdpred0)*qt(1-alpha/2,df0)
list(bootstrap.confidence.interval=c(LB,UB),normal.confidence.interval=c(NLB,NUB))
}
> regpred<-
function(xpred,xmat,y){
##
ls.str<-lsfit(xmat,y)
#calculate prediction
ypred<-ls.str$coef%*%c(1,xpred)
#use ls.diag to extract covariance matrix
ycov<-ls.diag(ls.str)$cov.unscaled
#use ls.diag to extract std deviation
std.dev<-ls.diag(ls.str)$std.dev
#variance of data around line
v1<-std.dev^2
#variance of prediction
vpred<-v1*c(1,xpred)%*%ycov%*%c(1,xpred)
df=length(y)-length(diag(ycov))
list(pred=ypred,sd=sqrt(vpred),df=df)
}
In: Computer Science
On January 1, Pulse Recording Studio (PRS) had the following account balances.
| Accounts Payable | $ | 8,500 |
| Accounts Receivable | 6,700 | |
| Accumulated Depreciation—Equipment | 6,500 | |
| Cash | 3,760 | |
| Cash Equivalents | 1,620 | |
| Common Stock | 10,700 | |
| Deferred Revenue | 3,900 | |
| Equipment | 30,000 | |
| Notes Payable (long-term) | 12,700 | |
| Prepaid Rent | 2,430 | |
| Retained Earnings | 2,730 | |
| Supplies | 520 | |
The following transactions occurred during January.
Required:
REQUIREMENTS:
1. General Journal tab - Prepare the journal entries to record the transactions that occurred from January 1-31. Review the accounts as shown in the General Ledger and Trial Balance tabs. Then prepare the necessary adjusting entries at January 31 to correctly report net income for the period.
2. General Ledger tab - Each journal entry is posted automatically to the general ledger. Use the drop-down button to view the unadjusted and adjusted balances in the General Ledger.
3. Trial Balance tab - You may view either the unadjusted and adjusted trial balance by choosing from the drop-down.
4. Income Statement tab - Use the drop-down to select the accounts properly included on the income statement. The unadjusted and adjusted balances will appear for each account based on your selection.
5. Statement of Retained Earnings tab - Prepare the bank reconcilation for the year ended January 31.
6. Balance Sheet tab - Use the drop-down to select the accounts to properly included on the balance sheet. The unadjusted and adjusted balances will appear for each account, based on your selection.
7. Analysis tab - Using the information from the requirements above, complete the 'Analysis' tab.
In: Accounting
Discuss how x-inefficiencies arise and how they explain why the measure of the deadweight loss of a monopoly (i.e., Harberger’s) may be too low? Include a graph in your answer that shows the increase in deadweight welfare loss due to x-inefficiencies.
In: Economics
4. Suppose from our class (with 25 students), we find the
average GPA is 2.7, with standard deviation
0.4. Regard our class as a random sample from the whole university.
Based on the information from our
class, can we believe at significance level 0.05, that the average
GPA for all students can be at least 2.8?
In: Math
2D Car Collision
Car Collision in 2D (c7p50) A 900- kg car collides with a 1400- kg car that was initially at rest at the origin of an x-y coordinate system. After the collision, the lighter car moves at 10.0 km/h in a direction of 35 degrees with respect to the positive x axis. The heavier car moves at 13 km/h at -41 degrees with respect to the positive x axis.
A) What was the initial speed of the lighter car (in km/h)? ____Tries 0/7
B) What was the initial direction (as measured counterclockwise from the x-axis)? ___Tries 0/7
In: Physics
Biochemical Tests crossword puzzle:
Across
5 Anaerobic metabolism
6 Crusty growth on broth
8 Cloudy growth in broth
10 Smooth growth on slant
11 Another name for glucose
13 Hydrolyzed collagen
15 Possible sole carbon source
16 Bacterial movement
17 Test use of milk nutrients (2wds)
20 Hydrolyzes starch
22 Bacteria settled to bottom of broth
23 Milk sugar
27 Test for acetoin
28 Produces clear zones in skim milk agar
29 pH indicator in sugar fermentation tubes (2wds)
Down
1 Produced from tryptophan 2 Group of 4 tests
3 Red when acidic (2wds)
4 Turns SIM black
7 Catalysts secreted by the cell
9 Inverted tube to trap gas
12 Tests for lipase
14 Common liquid medium (2wds)
16 Sticky surface growth on broth
18 Breaking macromolecules with addition of water 19 Snowy
appearance in broth culture
21 E. coli produces this from glucose (3wds)
24 Spiky growth on slant
25 Breaks down hydrogen peroxide
26 Product of amino acid degradation
In: Biology
what are legal requirements and ethical issues in capturing and analyzing digital images in health sector
In: Nursing
Consider a monopolist with a linear demand curve: q = a − bp,
where a;b > 0. It produces at constant marginal cost c and has
no fixed cost. Assume that 0 < c < a b.
(a) Find the monopoly price, quantity, and profits. (b) Derive the
inverse demand curve P(q). Draw P(q), the MRcurve, and the MC-curve
in a diagram. Explain why we need the assumption c < a b. (c)
Does it matter that the monopolist sets price instead of quantity?
(d) Calculate the deadweight loss of monopoly. (e) A change in b
results in two opposing effects on the deadweight loss. Calculate
the effect of a change in b on the deadweight loss. (f) Derive the
price elasticity of demand η for any price. How does η change with
p? (g) Show mathematically as well as graphically that the price
elasticity of demand η > 1 at the monopoly price.
In: Economics
At t=0 a grinding wheel has an angular velocity of 27.0 rad/s . It has a constant angular acceleration of 25.0 rad/s2 until a circuit breaker trips at time t = 2.00 s . From then on, it turns through an angle 430 rad as it coasts to a stop at constant angular acceleration.
Through what total angle did the wheel turn between t=0 and the time it stopped?At what time did it stopWhat was its acceleration as it slowed down?
In: Physics
Independent Sample T Test (Student Height)
Open College Student Data
Research Question: Is there a significant difference between genders on average student height?
Record the following:
1)What test will you run to answer this research question? Why?
2)Is Assumption One: Equal Variances met? How do you know?
3)Is Assumption Two: Normality met? How do you know?
4)Is Assumption Three: Independency met? How do you know?
5)What are the means? (Male and Female)
6)Answer the research question. How do you know?
7)Which gender is statistically taller? How do you know?
8)Is there an effect size (Cohen’s D)? If so what is it? How did you arrive at the effect size? Is it small, medium, large or very large? How do you know?
DATA SET
height gender (1 - male, 2 - female)
67.00 2
72.00 1
61.00 2
71.00 1
65.00 2
67.00 1
69.00 1
75.00 1
62.00 2
61.00 2
64.00 2
64.00 1
70.00 1
63.00 2
64.00 2
63.00 2
65.00 2
71.00 1
72.00 1
68.00 2
75.00 1
67.00 2
69.00 1
67.00 1
64.00 2
64.00 2
70.00 1
64.00 1
70.00 1
72.00 1
64.00 2
71.00 1
67.00 2
63.00 2
69.00 1
68.00 1
64.00 2
70.00 1
71.00 1
72.00 1
60.00 2
65.00 2
72.00 1
63.00 2
75.00 1
71.00 1
65.00 2
69.00 1
63.00 2
67.00 2
In: Math
Researchers conducted a study to investigate the effectiveness of two different treatments for depression (Lithium or Imipramine). A sample of individuals diagnosed with bipolar depression were divided into three groups - one group received Lithium, one group received Imipramine, and the last group was given a placebo. After a specified length of time, patients are evaluated for a recurrence of depression. Use StatCrunch to conduct a chi-square test to determine if recurrence is related to the treatment prescribed. In StatCrunch, select Stat > Tables > Contingency > With Data. Select one of the variables of interest for the row variable and the second variable as the column variable. Then click Compute.
Throwback Question: Suppose we know that the risk of liver cancer among alcoholics without cirrhosis of the liver is 29.8%. A researcher conjectures that the risk of cancer among alcoholics with cirrhosis of the liver is higher. Suppose we sample 81 alcoholics with cirrhosis of the liver and determine 29 have liver cancer. Use this information to answer the following:
In: Math
Java only !!! Please write the following method that sorts an ArrayList of numbers: public static void sort(ArrayList < Integer > list)
Prompts user to enter 5 ints stores them into an array list and display them in increasing order
In: Computer Science