Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Dropbox link if image doesnt show: https://www.dropbox.com/s/5m7ud3q6euelt59/Unt

ID: 3548160 • Letter: D

Question

Dropbox link if image doesnt show:

            https://www.dropbox.com/s/5m7ud3q6euelt59/Untitled.jpg

Design a class ObservedFunction to represent a function composed of a list of observation collected at evenly spaced intervals, a function such as the distance function shown in Table 10.5. Assume that the initial observation is made at time 0, and that additional observation are recorded at times 1, 2, 3, and so on for sometime unit. Include as private components of the class an array of observed values and the names of the time unit and the observations unit. For Table 10.5. these units would be "min" and "km". Either include a constructor function that initializes all components. Define a member function that approximate an ObservedFunction object's first derivative, storing this first derivative in an ObservedFunction object passed as a reference parameter. Use the central difference formula when possible. Define another member function to calculate the second derivative.

Explanation / Answer

The absurd function in Data.Void has the following signature, where Void is the logically uninhabited type exported by that package:

I do know enough logic to get the documentation's remark that this corresponds, by the propositions-as-types correspondence, to the valid formula ? ? a.

What I'm puzzled and curious about is: in what sort of practical programming problems is this function useful? I'm thinking that perhaps it's useful in some cases as a type-safe way of exhaustively handling "can't happen" cases, but I don't know enough about practical uses of Curry-Howard to tell whether that idea is on the right track at all.

EDIT: Examples preferably in Haskell, but if anybody wants to use a dependently typed language I'm not going to complain...

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote