answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Sunny_sXe
15 days ago
15

a.Write a Python function sum_1k(M) that returns the sum푠푠= ∑1푘푘푀푀푘푘=1b.Compute s for M = 3 by hand and write

another function test_sum_1k() that calls sum_1k(3) and checks that the answer is correct. When you call the sum_1k(3) function, you will see some messages according to if the test is successful or not.
Computers and Technology
1 answer:
8_murik_8 [964]15 days ago
8 0
def sum_1k(M): s = 0 for k in range(1, M+1): s = s + 1.0/k return s def test_sum_1k(): expected_value = 1.0+1.0/2+1.0/3 computed_value = sum_1k(3) if expected_value == computed_value: print("Test is successful") else: print("Test is NOT successful") test_sum_1k() It appears that the hidden portion involves summing (sigma) from 1 to M with the term 1/k. Accordingly, within sum_1k(M), one should iterate from 1 to M to compute and return the sum of the expression. The test_sum_1k() function calculates the expected_value, an accurate hand-calculated value, while computed_value denotes the result of sum_1k(3). The values are then compared and an appropriate message is printed. Finally, invoke test_sum_1k() to observe the result.
You might be interested in
Which of the following attributes of a website indicates a more reliable source for information?
amid [951]
A characteristic of a website that signifies a more trustworthy source of information is when it has a domain ending in ".edu". This top-level domain is associated with educational institutions, indicating that the site is connected to universities, colleges, or other educational entities, thus providing reliable and factual information.
3 0
23 days ago
Explain how abstraction is used in a GPS system
ivann1987 [1066]

Answer

Abstraction in GPS technology allows the system to use clearly defined interfaces while enabling the integration of additional, more complex functionalities.

Explanation

The GPS system employs abstraction to organize layers of complexity for user interaction. It connects satellite-based positioning and timing systems to enable a radio receiver to acquire signals across four dimensions—latitude, longitude, altitude, and time—after synchronizing this data.


7 0
2 months ago
Read 2 more answers
The processing of data in a computer involves the interplay between its various hardware components.
Amiraneli [1052]

Affirmative.

Data processing entails transforming raw data and managing its flow through the Central Processing Unit and Memory to output devices. A computer's CPU contains two main parts: the Arithmetic Logic Unit (ALU) and the control unit. The ALU handles complex calculations and logical operations, while the control unit retrieves, decodes instructions, and regulates the data exchange between Memory, ALU, primary and secondary storage, along with various output devices.


8 0
17 days ago
When handling project scope creep, which are two things that all parties involved need to be aware of?
zubka84 [1067]

Additional resources required for the projects

Added time necessary for the project

Clarification:

In any project management scenario, there will naturally be unexpected changes and additional needs, hence to successfully complete a project, one must allocate more time and resources. It is advisable that, based on the project specifics, the end user should maintain a sufficient buffer to accommodate any variations in human resources and the extra time necessary for project completion.

When planning the project, a consideration of extra time per each task is essential.

Every task within project management is categorized under distinct scopes of work.

3 0
1 month ago
In cell e5, create a formula using the vlookup function to determine the dog type for teen anna morante based on the program cod
Natasha_Volkova [1026]
Hi! For utilizing the VLOOKUP function, you require the value to search for, the table’s range, and the specific column that has the return value. In your scenario, you provided both the range and the column; however, it’s unclear what value you wish to look up. For this explanation, let’s assume you want to search for the value in cell D5. Feel free to modify it according to your needs.

In syntax form, it will be:
=VLOOKUP(D5,G4:H7,2)
3 0
1 month ago
Read 2 more answers
Other questions:
  • Sites like Zillow get input about house prices from a database and provide nice summaries for readers. Write a program with two
    12·1 answer
  • Assume a program requires the execution of 50 x 106 FP instructions, 110 x 106 INT instructions, 80 x 106 L/S instructions, and
    9·1 answer
  • Which of these is an example of the integrity principle that can ensure your data is accurate and untampered with?
    10·2 answers
  • An Internet user has a need to send private data to another user. Which of the following provides the most security when transmi
    14·2 answers
  • Form the recurrence relations (RRs) for the number of vertices and the number of edges of a hypercube of n dimensions, Hn. Solve
    13·1 answer
  • Assume that the following variables have been properly declared and initialized.
    12·1 answer
  • Write an expression that will cause the following code to print "18 or less" if the value of user_age is 18 or less. Write only
    9·2 answers
  • What term best describes the grammatical rules for writing proper code? paths syntax hyperlinks declarations
    7·2 answers
  • A 2-dimensional 3x3 array of ints, has been created and assigned to tictactoe. Write an expression whose value is true if the el
    10·1 answer
  • Consider two different implementations, M1 and M2, of the same instruction set. There are three classes of instructions (A, B, a
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!