GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

The coefficient of restitution of a ball is a number between…

The coefficient of restitution of a ball is a number between 0 and 1. This number specifies how much energy is conserved when the ball hits a rigid surface. A coefficient of .9, for example, means a bouncing ball will rise to 90% of its previous height after each bounce. If you drop the ball from an initial height of 10 meters, it will rise to 9 meters (10 * .9) on the first bounce, 8.1 meters (9 * .9) on the second bounce, 7.29 meters (8.1 * .9) on the 3rd bounce, and so on. Write a function named simulate_bounce that accepts 3 arguments: a coefficient, an initial height hi (in integer meters), and a threshold height ht (in integer cm). Your function should use a loop to calculate and return a tuple containing: The number of bounces until the ball rises to a height less than ht. The total distance traveled by the ball (in meters). Note that the final rise and fall of the ball (to the height less than ht) is not counted in this distance: In [1]: simulate_bounce(0.21, 10, 57) Out[1]: (2, 14.2) In [2]: simulate_bounce(0.6, 2, 18) Out[2]: (5, 7.2223999999999995) In [3]: simulate_bounce(0.49, 7, 43) Out[3]: (4, 18.868485999999997)

Read Details

Exam will include short-answer questions and essay type ques…

Exam will include short-answer questions and essay type questions and they will cover materials from the reading, Discussion, and the additional course materials. The list of exam questions will be shared by the end of Week 5 to help you prepare. Exams will be proctored via Honorlock.Please ensure that your answers are between 150-200 words for each question, including in-text citations for the articles read in class. You are expected to take exams as scheduled. Failure to do so will result in a zero for the missed exam. Only under exceptional circumstances will make-up exams be permitted. A new and alternative exam will be written for this purpose, and the content and format may differ from the original exam format. Make-up exams will only be granted when all three of the following conditions are met: 1) the student notifies me at least 24 hours prior to the scheduled exam time; 2) the circumstances are extenuating; and 3) the student presents proof of the extenuating circumstances.

Read Details

Given: def divide(num1, num2): if num2 != 0: return num1 / n…

Given: def divide(num1, num2): if num2 != 0: return num1 / num2 …and: In [11]: divide(a, b) In [12]: What is the value of the variable a?

Read Details

families is a data frame consisting of records about familie…

families is a data frame consisting of records about families, including their number of children and their income (on a scale of 0 – 9). What expression returns a DataFrame containing all records where the family has more than 2 children and all records where the family’s income is above 7?

Read Details

Consider: 0 not in [n % i for i in range(2,n)] This expressi…

Consider: 0 not in [n % i for i in range(2,n)] This expression…

Read Details

Consider: x[~np.isnan(x)] This expression demonstrates what…

Consider: x[~np.isnan(x)] This expression demonstrates what concept we learned in class?

Read Details

Given: a = np.loadtxt(filename, delimiter=”,”) How does NumP…

Given: a = np.loadtxt(filename, delimiter=”,”) How does NumPy determine the data type of the array a?

Read Details

What method can you call to get basic statistics (count, mea…

What method can you call to get basic statistics (count, mean, median, std, etc) after grouping a DataFrame?

Read Details

The pandas DataFrame candidates has, among other columns, th…

The pandas DataFrame candidates has, among other columns, the name of applicants for a job opening and a logical (or Boolean) column named complete which indicates whether or not the candidate’s application is complete. Which expression returns a DataFrame consisting of all candidates with complete applications?

Read Details

The DataFrame df contains, among other columns, a column rep…

The DataFrame df contains, among other columns, a column representing the salary of each entry in the data. To return a DataFrame sorted by salary, you use: df.sort_values(‘salary’) What is the best way to modify this statement such that the record with the highest salary appears first in the output?

Read Details

Posts pagination

Newer posts 1 … 37,711 37,712 37,713 37,714 37,715 … 85,744 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top