Compute the cartesian products

Assignment Help Other Subject
Reference no: EM132379446

Assignment -

Directions - Name your scripts 253-yourlastname-?-?.py. For example, my submission for P3 problem 4 would be a file 253-pauli-3-4.py.

(1) (PT) Read and work through the examples in

§3.1.3: Lists

§5.1.3: List Comprehensions

§5.4.: Sets

(2) (NP) Read and work through the examples in

  • Lists

(3) Write a script that contains the following. For each part, first print the number to make it easier to grade.

(a) A function is_subset(A,B) that for two sets A and B returns True if A ⊆ B and False otherwise. Use a for loop and in but not the build-in <=.

(b) A function is_proper_subset(A,B) that for two sets A and B returns True if A ⊂ B and False otherwise. Use a for loop and in but not the build-in <.

(c) Verification whether your functions work correctly by using them to determine whether the following are true or false. Use set comprehensions to construct sets given in set builder notation.

(i) ∅ ⊂ ∅

(ii) ∅ ⊆ ∅

(iii) {1, 2, 3} ⊆ ∅

(iv) ∅ ⊆ {1, 2, 3}

(v) {1, 2, 3} ⊆ {1, 2, 3}

(vi) {1, 2, 3} ⊂ {1, 2, 3}

(vii) {1, 4} ⊆ {x2|x ∈ {1, 2, 3, . . . , 20}}

(viii) {4, 10} ⊆ {x| x ∈ {1, 2, 3, . . . , 50} Λ x mod 3 = 1}

(ix) {x2|x ∈ {1, 2, 3, . . . , 50} Λ x mod 3 = 0} ⊂ {3, 81}

(4) Write a script that contains the following. For each part, first print the number to make it easier to grade.

(a) A function cartesian_product(A, B) that returns the cartesian product of two sets A and B. You can represent the tuple (a, b) either as a tuple or a list with two elements.

(b) Verification whether your functions works correctly by using them to compute the following cartesian products:

(i) {1, 2, 3} x {5, 6}

(ii) {1, 2} x {2}

(iii) {7} x {1, 2, 3, 4}

(iv) ∅ x {1, 2, 3, 4}

(v) {1, 2, 3, . . . , 40} x {1, 2}

Attachment:- Assignment File.rar

Reference no: EM132379446

Questions Cloud

Compute the companys current income tax expense or benefit : Woodward Corporation reported pretax book income of $1,000,000. Included in the computation were favorable temporary differences of $200,000.
Demonstrate logical and creative thinking in the analysis : Demonstrate logical and creative thinking in the analysis and application of a theory to nursing practice. Examine broad theoretical concepts as foundational.
What is the present value of an ordinary annuity consisting : What is the present value of an ordinary annuity consisting of 10 annual payments of $100 with an interest rate of 9% per annum.
Compute the future value in year 9 of deposit in year one : Compute the future Value in year 9 of a $3900 deposit in year one and another $3400 deposit at the end of year 5 using a 9% interest rate.
Compute the cartesian products : Verification whether your functions works correctly by using them to compute the following cartesian products: {1, 2, 3} x {5, 6}
What is the estimated cost for a patient whose surgery has : Recent research into the cost of various medical procedures has shown the impact of certain complications encountered in surgery on the total cost.
What impact might your solution have on the other levels : Many of you have experience in complex adaptive systems whether you realize it or not. Thinking about your current or future practice area, identify an issue.
What was the biggest obstacle you encountered : What worked best for this online course? What was the biggest obstacle you encountered? What suggestion would you have for improving the course layout?
Calculate the pooled variance : Calculate the power and n required using a single gene calculation for illustration of the formula and Calculate the pooled variance

Reviews

len2379446

9/30/2019 11:13:30 PM

Each project script should be uploaded to Canvas. Rubric - 10–9 pts: Script runs without errors. All required components are correctly addressed. The difference between 9 and 10 comes from coding style (comments, structure) and writing style (grammar and spelling in responses). 8–6 pts: Script runs without errors but some required component is missing or incorrect. The score in this range depends on the what is missed. 5 pts: Script does not run because of errors. 0 pts: No submission.

Write a Review

Other Subject Questions & Answers

  Demand forecasting on the supply chain-bullwhip effect

How is the impact of demand forecasting on the supply chain related to the bullwhip effect? Make answer as brief as possible.

  How are processes of learning in the organization evaluated

For the first part of this week's section of the course project, briefly review your chosen organization (Walmart). Presume that the reader does not know.

  Demonstrate knowledge of emergency management policies

Demonstrate knowledge of emergency management policies and programs in United States. Clear description of core mission and goal you have selected to discuss.

  A relationship between stress and personality

What evidence exists to establish a relationship between stress, personality, and negative mood?

  The management of white industries related issues

Using the .10 level of significance, can we conclude that the assembly time using the new method is faster?

  The earthlink company is a communications network and it

the earthlink company is a communications network and it services that is located in atlanta georgia. the company

  What is interrater reliability

What are the problems of social desirability when conducting surveys? What is Interrater reliability?

  Explain the value professional nursing organizations have

Explain the value that professional nursing organizations have in networking and in the legislative process. Provide a rationale for your response.

  Describe the concept of the unequal society

Applied Sociological Perspectives for Health and Social Care-BN018467 – Specification – Edexcel Level 3 BTEC Nationals in Health and Social Care-NQF Level 3.

  About professional networking

Professional Networking

  Discuss particular concern to the parties

discuss the legal issue(s) that should be of particular concern to the parties

  Describe why there is a change from software results

Analyzation from using MUSIC software. In this section You want the screenshots from the software and explain how we get the results.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd