Questions
In Python: def _nodeAtIndex(self, index): """Returns the reference to the node at the given index; If...

In Python:

def _nodeAtIndex(self, index):
"""Returns the reference to the node at the given index;
If index is out of range, raise IndexError
"""
# PROBLEM 2
# You can assume that index is non-negative.
# You need to traverse the list and stop at the required index.
# YOUR CODE HERE
(THIS IS WHAT I HAVE CURRENTLY WRITTEN BUT I"M STUCK AND DON"T KNOW WHAT TO DO)

while current != None: # use a while-loop.
plist.append(current._element) # process the stored element.
count = 0 #Will give us the index of current node
if (count == index):
return (plist)
  
raise IndexError('The index is out of range')

Down below is the following code that give's more detail about the code. If you have any question's or need any more info, please don't hesitate to ask.

class SLinkedList:
"""Singly linked list with access to front and end, and with stored size.
"""

#-------------------------- nested _Node class --------------------------
class _Node:
__slots__ = '_element', '_next' # streamline memory usage

def __init__(self, element, next):
self._element = element
self._next = next

#------------------------------- queue methods -------------------------------
def __init__(self):
"""Create an empty list."""
self._head = None
self._tail = None
self._size = 0

def __len__(self):
"""Return the number of elements in the list."""
return self._size

def isEmpty(self):
"""Return True if the list is empty."""
return self._size == 0
  
# READ THIS!
def __repr__(self):
plist = []
current = self._head
# This is how to traverse a list:
while current != None: # use a while-loop.
plist.append(current._element) # process the stored element.
current = current._next # jump to the next node.
return "SLinkedList(%s)" % repr(plist)

def first(self):
"""Return but do not remove the first element.
Raise EmptyError if the list is empty.
"""
if self.isEmpty():
raise EmptyError('The SLinkedList is empty')
return self._head._element
  
def deleteFirst(self):
"""Remove and return the first element.
Raise EmptyError if the list is empty.
"""
if self.isEmpty():
raise EmptyError('The SLinkedList is empty')
answer = self._head._element
self._head = self._head._next
self._size -= 1
if self.isEmpty(): # special case when list is empty
self._tail = None # removed head had been the tail
return answer
  
def addFirst(self, e):
"""Add element e to the front of the list."""
self._head = self._Node(e, self._head) # create and link a new node
if self._tail == None: # special case when list was empty
self._tail = self._head # added head is the tail
self._size += 1
  
def addLast(self, e):
"""Add e to the end of the list."""
newest = self._Node(e, None) # node will be new tail node
if self.isEmpty():
self._head = newest # special case: previously empty
else:
self._tail._next = newest
self._tail = newest # update reference to tail node
self._size += 1
  

In: Computer Science

(a) In an attempt to help students find employment, assume thatthe government provides a wage...

(a) In an attempt to help students find employment, assume that the government provides a wage subsidy to employers who hire students during the summer months. Analyse the potential impacts of such a policy on labour markets and student incomes/poverty.

(b) How would your results/analysis change if you were told that the elasticity of supply of student labour was more inelastic than you initially thought.

(c) If you were asked to evaluate the effectiveness of this policy, describe how you would do that. Describe the research method you would use, that you think is best and why, and the data you would use to discern the impact of the policy on student employment.

In: Economics

I read a claim that 40% of Americans struggle to afford at least one basic need...

I read a claim that 40% of Americans struggle to afford at least one basic need for housing, healthcare, utilities, or food. A Math 146 student hopes this proportion is lower for Bellingham Technical College students.

Part A) what are null and alternate hypotheses?

Part B) the student conducts a random survey of 56 fellow students at BTC which returns a sample proportion of 38% who cannon afford basic needs. Test the claim 5% significance leve. State all reasoning, steps, values and interpretations needed for the test.

Part C) Should we accept or reject the null hypotheses? state the conclusion of this study with respect to the claim in clear simple language.

In: Statistics and Probability

Suppose you are trying to show that there is a relationship between gender, living arrangement and the number of texts sent daily among students.

 

Prompt: Suppose you are trying to show that there is a relationship between gender, living arrangement and the number of texts sent daily among students. You take a sample of 12 students, record their gender (F&M) and ask whether they live at home (H), campus (C), or off campus (O)

  H C O

F

3 & 7 9 & 13 12 & 16
M 1& 5 3 & 7 2 & 6

Questions: (Known top row effect = +3, sum of square total =244)

1. What is the sum of squares interaction? (correct answer is 32)

2. What is the mean square for the row variable? (correct answer is 108)

In: Statistics and Probability

Find the linear regression equation (line of best fit), determine the correlation, and then make a...

Find the linear regression equation (line of best fit), determine the correlation, and then make a prediction.

1. The table below gives the amount of time students in a class studied for a test and their test scores.

Graph the data on a scatter plot, find the line of best fit, and write the equation for the line you draw.

Hours Studied

1

0

3

1.5

2.75

1

0.5

2

Test Score

78

75

90

89

97

85

81

80

Linear Regression Equation: ____________________

Correlation Coefficient (r): _________

Type of Correlation: ______________________

Is the correlation strong? Explain

Using the linear regression equation predict

a students test score if they studied for 4 hours.

In: Statistics and Probability

A researcher is interested in the breakfast and exercise habits of college students. For some randomly...

A researcher is interested in the breakfast and exercise habits of college students. For some randomly selected students, he recorded the number of times they had breakfast in one month and the number of times they went to gym. The correlation for these two variables ended up being 0.74. If a college student who had never previously gone to the gym began going to the gym regularly, what does this imply about the future habits of that student?

Select one:

a. He will have breakfast more regularly.

b. He will stop having a breakfast.

c. We cannot conclude that working out in the gym will affect the future breakfast habits of this person.

d. He will have breakfast in the gym.

In: Statistics and Probability

Suppose that a lecturer gives a 10-point quiz to a class of five students. The results...

Suppose that a lecturer gives a 10-point quiz to a class of five students. The results of the quiz are 3, 1, 5, 9, and 7. For simplicity, assume that the five students are the population. Assume that all samples of size 2 are taken with replacement and the mean of each sample is found.

Questions:

  1. Calculate the population mean and standard deviation
  2. Suppose that you obtain at least 20 random samples of size 2. From data obtained by you, find a frequency distribution of sample means and draw a graph (namely, histogram) of the sample means.
  3. Confirm whether your histogram appears to be approximately normal.
  4. Calculate the mean of sample means and standard deviation of sample means.

In: Statistics and Probability

Economics: Supply and Demand USF issues parking permits to allow students to park on campus. The...

Economics: Supply and Demand

USF issues parking permits to allow students to park on campus. The price of the permit is set by college administrators at their discretion, they do not consider market conditions. At the current price, some students complain that there aren’t enough spaces for them to park.

A) Describe this situation in economic terms and describe what this implies about the market equilibrium and the price of a parking permit.

B) Should the price of a parking permit be raised or lowered to fix this problem? Why? Explain.

C) Use the supply and demand model to describe how a graph of the market for parking permits would be affected by a change in price. You must include a graph and describe the graph.

PLEASE HELP !

In: Economics

Vitamin C is becoming an issue. A researcher thinks that high school students are getting enough....

Vitamin C is becoming an issue. A researcher thinks that high school students are getting enough. The researcher does a study of many local schools. The table shows the number of student who got the daily, recommended allowance of vitamin C. Can you conclude that the numbers of students who got the daily, recommended allowance of vitamin C is the same for all grades? Test the claim at the level of significance of .05.

Grade 9

Grade 10

Grade 11

Grade 12

34

79

89

90

45

31

89

36

34

49

45

88

40

46

36

55

61

31

30

13

22

In: Statistics and Probability

Are the educational aspirations of students related to family income? This question was investigated in the...

Are the educational aspirations of students related to family income? This question was investigated in the article “Aspirations and Expectations of High School Youth” (Int. J. of Comp. Soc. (1975): 25). The accompanying 4 X 3 table resulted from classifying 273 students according to expected level of education and family income. Does the data indicate that education aspirations and family income are not independent? Conduct hypothesis test using = .05. Income Aspired Level Low Middle High Some High School 9 11 9 High School Graduate 44 52 41 Some College 13 23 12 College Graduate 10 22 27

In: Statistics and Probability