Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

P1.10.10 Suppose we have a set of sports teams in a league L, and a set of games G among those teams. Each game has

image text in transcribed

P1.10.10 Suppose we have a set of sports teams in a league L, and a set of games G among those teams. Each game has a home team and a visiting team, who are two different teams in the league. We have predicates H(g,t) meaning "team t was the home team in game g" and V(9,t) meaning "team t was the visiting team in game g". (a) Consider the predicate P(s, t) meaning "team s played a game against team t". Can you express this predicate in terms of the predicates H and V, along with boolean operators? Either do it or explain (informally) why you cannot. (b) If I have a list of the games played, and access to the H and V predicates, how could I compute the value of P(s, t) given two teams s and t? (c) (uses Java) Assume that you have a Java class Game that includes instance meth- ods boolean home (Team t) and boolean visitor (Team t). Write a static method boolean played (Team s, Team t, Game [ ] season) that will input two teams and an array of games, and return true if and only if P(s, t) is true for the set of games in the array. P1.10.10 Suppose we have a set of sports teams in a league L, and a set of games G among those teams. Each game has a home team and a visiting team, who are two different teams in the league. We have predicates H(g,t) meaning "team t was the home team in game g" and V(9,t) meaning "team t was the visiting team in game g". (a) Consider the predicate P(s, t) meaning "team s played a game against team t". Can you express this predicate in terms of the predicates H and V, along with boolean operators? Either do it or explain (informally) why you cannot. (b) If I have a list of the games played, and access to the H and V predicates, how could I compute the value of P(s, t) given two teams s and t? (c) (uses Java) Assume that you have a Java class Game that includes instance meth- ods boolean home (Team t) and boolean visitor (Team t). Write a static method boolean played (Team s, Team t, Game [ ] season) that will input two teams and an array of games, and return true if and only if P(s, t) is true for the set of games in the array

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Autonomous Database In Enterprise Architecture

Authors: Bal Mukund Sharma, Krishnakumar KM, Rashmi Panda

1st Edition

1801072248, 978-1801072243

More Books

Students also viewed these Databases questions

Question

Find dy/dx. x = sin 2 , y = cos 2

Answered: 1 week ago