Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Math Expert


Home >> Math

Question 6

Consider the following scenario. -

A piece of software stores information about digital songs and keeps track of when they were listened to Each song is associated with a song name, an artist and an album title; each song is also associated with a unique identifier.

We assume the existence of a number of basic types.:

[SongName, Artist, Album Title, Id)

We also assume that a set, Time, has been defined. We algo assume an accompanying ordering relation, <Time, and a special element miltirne C Time.

We also assunie an abbreviation, Length:

Length == N

Two structures are of interest to us. The first, songs, captures the details of the songs stored by our software; the second, plays, captures 'play details' - which songs were played and when:songs : Id -I-, (SongNarne x Artist x Album Title x Length x Time) plays : seq (Id x Time)

Each element of the range of songs is a quintuple, consisting of: a song name; an artist; an album title; the length of the song (in terms of seconds); and the time at which the song was added.

Each element of plays is a pair, detailing which songs were played and when. So, for example, if the song associated with the identifier idl has been played three times, we would expect to see three entries for idl in plays_

The expectation is that each identifier appearing in plays will also appear in songs, that niltime will not appear in the range of plays, and that the elements of plays will be ordered from earliest to latest.

Add three constraints to the above axiomatic definition to enforce this behaviour.

Question 7

Building upon the definitions of Question 6, define set comprehensions that capture the following.

(a)   The set of all 'duplicate' songs - defined as (SongName, Artist) pairs - which appear in songs more than once.

(b)   The set of all songs___ again, defined as (SongName, Artist) pairs -
which have not been played.

(c)   The set of albums which have had none of their tracks played.

(d)   The set of all songs__ again, defined as (SongName, Artist) pairs -
which have been played more than 10 times.

Question 8

(a)   Define a recursive function, totalplaytirne, that sums up the length of time of the played songs appearing in a given sequence of type seq (Id x Time). Your function will need to make reference to songs.

(b)   Show, via an inductive proof, that

V s, t seq (Id x Time) •

totalplaytime (s t) = totalplaytime (s) totalplaytime (t)

Question 9

A structure combining information from songs and plays can be defined using the following definition:

SongsAndPlaysList == seq SongDetails 

We assume the existence of the following abbreviation:

SongDetails ==  Id × SongName × Artist × AlbumTitle ×  Length × Time × Time × N 

Here, the details of each song consists of: an identifier; a song name; an artist; an album title; the song length; the date it was added; the last time it was played; and the number of times it has been played.

(a) A valid element of SongsAndPlaysList will: ensure that there are no duplicate identifiers and ensure that any 'last played' time is later than

any 'date added' time. Define such a ValidSongsAndPlaysList structure. (b) Define a specific ValidSongsAndPlaysList, songs_and_plays, the values of which are defined by the values of songs and plays of Question 6.

(c) Show how the set comprehensions of Question 7 might be recast as set comprehensions on the sequence of part (b).

(d) Show how the recursive function of Question 8 might be recast as a function that takes a sequence of type seq SongDetails as input.

 

Question 10

You have been informed that the following statements are true:

  • "If the team wins all of its league matches, then the team will win the league."
  • "The team wins the cup if, and only if, the team wins all of its cup matches."

 

Assume that: AC represents "wins all cup matches"; AL represents "wins all league matches"; WC represents "wins the cup"; and WL represents "wins the league".

By using the above, prove each of the following via a proof tree.

(a) AC  Ù AL  => WC Ù WL  ( where AND = Ù)

(b) AC V AL => WC V WL (where V = or)

Each step in your tree should be labelled and justified by a basic introduction or elimination rule from our system.

Math, Academics

  • Category:- Math
  • Reference No.:- M9864645
  • Price:- $60

Priced at Now at $60, Verified Solution

Have any Question?


Related Questions in Math

Maths assignment - 1 analysis of a data setusing a

Maths Assignment - 1. Analysis of a data set Using a continuous data set you are requested to collect in the types of data and gathering data section, perform a statistical analysis on your data. You have opportunities t ...

Questions -q1 prove the following identitiesa sinx y sinx

Questions - Q1. Prove the following identities a. sin(x + y) + sin(x - y) = 2 sin x cos y b. sec(x - y) = cos(x + y)/(cos 2 x - sin 2 y) c. tan 2 x - sin 2 x = (tan x sin x) 2 Q2. Solve the following equations for x ∈ [0 ...

Question you will recommend a course of action regarding

Question: You will recommend a course of action regarding strategic planning in light of the issue the healthcare organization is facing. Be sure to address the following: 1. Provide a brief summary of the issue facing t ...

Questions - provide solution to the following questionsq1

Questions - Provide solution to the following questions: Q1. Evaluate the following: ∫xsin3xdx Q2. If , then for what value of α is A an identity matrix? Q3. The line y = mx + 1 is a tangent to the curve y 2 = 4x. Find t ...

Mathematics- algebraic geometry problemlet k denotes an

Mathematics- Algebraic Geometry Problem Let K denotes an algebraically closed field and let P 1 be constructed as in Example 5.5(a) in Gathmanns notes, i.e. P 1 is the gluing of X 1 = A 1 and X 2 = A 1 along  the open su ...

Assignment - provide solution to the following questionsq1

Assignment - Provide solution to the following questions: Q1. Evaluate the following: ∫xsin3x dx Q2. If , then for what value of α is A an identity matrix? Q3. The line y = mx + 1 is a tangent to the curve y 2 = 4x. Find ...

Assignment - solving the five question in the very details

Assignment - Solving the five question in the very details, thanks a lot. Question - Let a ∈ P n be a point. Show that the one-point set {a} is a projective variety, and compute explicit generators for the ideal I p ({a} ...

Question 1 what is the nth order approximation using taylor

Question: 1. What is the nth order approximation using Taylor series? 2. What is Error Propagation? 3. Please explain what the total numerical error is? Please illustrate how the change of step size will affect the total ...

Clarity succinctness writing your name and netid1

Clarity, succinctness, writing your name and Netid: 1 Indistinguishability 1. If {X n }n is computationally indistinguishable from {Y n } n , {Y n } n is computationally indistin- guishable from {Z n } n, then (select th ...

1 suppose that n 10088821 is a product of two distinct

1. Suppose that n = 10088821 is a product of two distinct primes, and Φ(n) = 10082272. Determine the prime factors of n. 2. It is easy to show that the converse of Fermat's Theorem does not hold; i.e., the congruence a n ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As