Assignment Chef icon Assignment Chef

Browse assignments

Assignment catalog

33,401 assignments available

[SOLVED] Math 231 — hw 6

1. Prove or disprove if this is a vector space using theorem 1.34 from the textbook: {(x1, x2, x3) | x1x2x3 = 0, xi ∈ R}. 2. Construct an example of a vector space W with two subspaces, W1, W2 where W1 + W2 ̸= W. 3. Let V = R 3 , and define two subspaces: • V1 = {(x, y, 0) | x, y ∈ R} • V2 = {(0, y, z) | y, z ∈ R} Prove that V1 + V2 forms a subspace of V . 4. Prove that V1 + V2 = V in the previous problem. 5. Let V = R 3 , and define two subspaces: • V1 = {(x, y, 0) | x + y = 0, x, y ∈ R} • V2 = {(0, y, z) | y + z = 0, y, z ∈ R} Prove or provide a counter example to the statement: V1 + V2 = V.

$25.00 View

[SOLVED] Math 231 — hw 5

1. Prove that for any v ∈ V , −(−v) = v. (Hint: Use Thm 1.32). 2. Suppose a ∈ F and v ∈ V . If av = 0, show that either a = 0 or v = 0. (Note: 0 is being used both for the additive identity of the field element and the additive identity of the vector space. This is an “abuse of notation,” but you should be able to tell which is which.) 3. Suppose −1 ∈/ F. Prove that there exists an element λ ∈ F such that for any v ∈ V, v + λv = 0.

$25.00 View

[SOLVED] Math 231 — hw 4

1. Show that V = Z 2 5 is a vector space (with addition being modulo 5 and scalar multiplication also being modulo 5). 2. Let P 3 = {ax3 + bx2 + cx + da, b, c, d ∈ R} be the space of polynomials up to degree 3 over the field R. Prove that P 3 is a vector space. (In other words, show that vector addition and scalar multiplication is closed. Then, do your best to show the other properties hold: associativity, additive identity, additive inverse, multiplicative identity, and distributivity.) To get you started, here is the proof of additive identity and the start of the proof for additive inverses: P 3 has an additive identity. Proof. Consider 0x 3 + 0x 2 + 0x + 0, which we will write as 0P and call the “zero polynomial.” Observe that 0P ∈ P 3 since 0 ∈ R. In addition, for any choice of ax3 + bx2 + cx + d ∈ P 3 ,ax3 + bx2 + cx + d  + 0P = (a + 0)x 3 + (b + 0)x 2 + (c + 0)x + (d + 0) (by vector addition) = ax3 + bx2 + cx + d (by additive identity of the field) Hence 0P is the additive identity of P 3 . P 3 is closed under additive inverses. Proof. Let ax3 + bx2 + cx + d ∈ P 3 be an arbitrary element in the space. Because R is a field, there exists −a, −b, −c ∈ R such that a + (−a) = 0, b + (−b) = 0, and c + (−c) = 0. · · · finish the argument

$25.00 View

[SOLVED] Math 231 — hw 2

1. Today we looked at an example of a finite field, a field with finitely many objects: Zp. TSuch structures are always fields when p is a prime number. For Z5, find all the additive and multiplicative inverse of the elements in the field: {0, 1, 2, 3, 4}. (Note that 0 will have no multiplicative inverse.) 2. For finite fields, p must be a prime number. To illustrate why Z4 is not a field, construct its multiplication table. Recall that a multiplication table is a table where the header row and first column list the elements of the set, and each cell contains the product of the corresponding row and column elements.

$25.00 View

[SOLVED] Math 231 — hw 1

1. Floating-point numbers are a way to represent real numbers in computers using a finite number of bits, expressed in scientific notation as a combination of a sign, a significand, and an exponent. This format allows representation of a wide range of values but introduces rounding errors and precision limits, leading to potential inaccuracies in arithmetic operations. As was stated in class, this space of numbers are not associative. Within your python terminal, demonstrate that floating point numbers are not associative using the following values: a = 1.0, b = 108 , c = −108 . Note: Exponentials are written using “E”. For example, 103 can be written as 1E3. 2. The example given in class used {1, 2, 3} with a ◦ b = max{a, b} and a ∗ b = min{a, b}. Demonstrate why 2 has no inverse under both operations (you can do this exhaustively). 3. Consider the space with {0, 1, 2} with operation a ◦ b = (a + b) mod 3. What axioms are satisfied? (You can skip the distributive property since there is only one operation.)

$25.00 View

[SOLVED] Math 231 — hw 3

1. Let S = {(x, y) ∈ R 2 | x + y = 1} be a space defined over the field R with addition defined as (a, b) + (c, d) = (a + c, b + d) and scalar multiplication as x(a, b) = (xa, xb) where x ∈ R and (a, b) ∈ S. Show why this is not a vector space. 2. Let U = {(x, y) ∈ R 2 | x ≥ 0, y ≥ 0}, with vector addition and scalar multiplication defined as the previous case. Show why this is not a vector space. 3. Define a set W = R 2 with addition defined as (x1, y1) + (x2, y2) = (x1 + x2, y1 + y2) and scalar multiplication defined as c · (x, y) = (cx, y). Show why this is not a vector space. 4. Let X = {(x, y, z) ∈ R 3 | x+y +z = 0}, with vector addition and scalar multiplication defined as usual. Show why this is not a vector space.

$25.00 View

[SOLVED] Homework 3 cs 417

Problem 1. Use Gauss’s method to show that 1 + 3 + 5 + . . . + (2n − 1) = n 2 . For example 1 + 3 = 4 = 22 , 1 + 3 + 5 = 9 = 32 . Problem 2. (10 points) Do 5 questions in Section 3.10 (Discussion questions). For the remaining problems, please submit a python file (jupyter notebook is also fine). For questions that ask for an explanation, please provide your answers as comments. Problem 3. (10 points) Do Questions 4 and 5 in Section 3.11 (Programming Exercises). Problem 4. A triangular number is a number that can be arranged in the shape of an equilateral triangle. Mathematically, n is a triangular number if we can find a positive integer k such that n = k(k + 1) 2 . The first few triangular numbers are described in the picture below. Write a function to check whether a given number n is triangualr or not. What is the big O-performance of your program? Problem 5. Let am be a sequence given by the following recursive formula a0 = 2, a1 = 5, am = 5am−1 − 6am−2 for m ≥ 2. The following questions are considered to be independent from each other (though, if you want to use one to solve the others, that is fine). 1 (1) Write a function to calculate the kth term of this sequence. You function should take k as the argument and return ak. (2) Given a number n. Write a function to check whether n belongs to this sequence (namely, there exists k such that ak = n). For example, 13 belongs to this sequence because a2 = 13. On the other hand, 20 is not a member of this sequence. Use a count variable inside your function to estimate the number of assignments in your function for n = 102 , 103 , 104 , 105 , 106 , 107 . What do you think is the big Operformance of your algorithm? (3) What if I tell you that the general formula for am is am = 2m + 3m.

$25.00 View

[SOLVED] Homework 1 cs 417

Problem 1. Let a, b, d ∈ Z. Suppose that d | a and d | b. (1) Show that d | a − b. (2) Let m, n ∈ Z. Show that d | ma + nb. Problem 2. Let a1, a2, . . . , an be integers. The greatest common divisor of a1, a2, . . . , an, denoted by gcd(a1, a2, . . . , an), is the largest positive integer d such that d | ai for each 1 ≤ i ≤ n. It is known that gcd(a1, a2, . . . , an) = gcd(an, gcd(a1, . . . , an−1)). Given a list of integers, say alist. (1) Write a recursive function named recursive gcd(alist) that takes alist as an input and return the greatest common divisor of all elements in alist. (2) Write a non-recursive function, named non recursive gcd(alist) to achieve the same goal. For this problem, you can use any functions that we wrote to compute gcd(a, b) for two given integers (this is the base case).

$25.00 View

[SOLVED] Cs 327 homework 3 mapping the er and eer models to the relational model.

EXERCISE 1. Map the following ER schema into a Relational schema. Specify all relation schemas, primary keys, and foreign keys. [30] EXERCISE 2. Map the following EER schema into a Relational schema using the mapping options A and B (from the lectures) for specialization (generalization). Specify all primary keys. Note that you do not have to follow the same mapping option for all specializations (generalizations) in a specialization (generalization) hierarchy. [20]

$25.00 View

[SOLVED] Cs 327 homework 1 basic concepts/ dbms architecture

Question 1: a. List any three advantages of using a database over traditional file storage. [3] b. List any three situations where using a database would be disadvantageous. [3] Question 2: a. Describe in your own words, what is meant by data abstraction. [2] b. Write in your own words, the difference between database schema and database instance. [2] Question 3: Write brief answers to the following, in your own words: a. When starting up your servers, which should you start first: the Apache web server or the MariaDB database server? Why? [3] b. What does A_I mean, in the context of a table column? What is it used for? [2] Question 4: Create a database called “college”. In it, create a table called “student.” It should have a numeric ID column that is the primary key, a firstname, a lastname (both 30 characters long), a decimal GPA column, an email column and a phone number column. Only the phone number column is allowed to be null, and the email must be unique. View the SQL code for the table creation and copy-paste it as the answer to this question. [5]

$25.00 View

[SOLVED] Math 240 — hw 7

Consider a small dataset with the following points: x y 1 2 2 3 3 5 4 4 We want to fit a linear model y = mx + b to this data using gradient descent. 1. Identify a good set of initial parameters for your model. 2. Compute the mean absolute error of your initial parameters: E(m, b) = 1 n Xn i=1 |yi − (mxi + b)| 3. Make one adjustment to m and b using the derivative of E with respect to m and b. What is your updated model? 4. compute the mean absolute error of your updated model.

$25.00 View

[SOLVED] Math 240 — hw 6

We stated in class that computing anti-derivatives from a specific point to another is an area under the curve. We can approximate this with rectangles and triangles. 1 2 3 4 5 5 10 15 20 25 (2, 4) (1, 1) (3, 9) (4, 16) x f(x) For this problem, we can estimate the area under this curve from 1 to 4 by computing the areas explicitly. The first column can be approximated by the area 1 2 (1)(3) = 3 2 (for the triangle) and (1)(1) = 1 is the area. The total area is 5 2 . The second column can be approximated by the area 1 2 (1)(5) = 5 2 (for the triangle) and (1)(4) = 4. The total area 13 2 . THe third column can be approximated by the area 1 2 (1)(7) = 7 2 (for the triangle) and (1)(9) = 9. The total area 25 2 . Putting these all together, we get the area 5 2 + 13 2 + 25 2 = 43 2 . Some things to notice: first, the y-values are coming from the function x 2 . The area of a rectangle is base times height. And the area of a triangle is half of base times height. 1. Estimate the area under 2x for x-values between 1 and 4. 2. Estimate the area under x 3 for x-values between 1 and 3.

$25.00 View

[SOLVED] Math 240 — hw 3

In today’s class, we continued Lagrange polynomials, which provide us with a way of finding the polynomial of degree n − 1 that goes through n points. The example we did today was three points to find a degree 3 polynomial (a quadratic). For a reminder, the Lagrange polynomial is constructed from basis polynomials, denoted as ℓi(x). It is L(x) = y1ℓ1(x) + y2ℓ2(x) + . . . + ynℓn(x). These basis elements are constructed from only the x-values of the points. They are defined as multiplying the following terms: x − xm xi − xm where m never equals i. The notation used in math is ℓi(x) = Y m,m̸=i x − xm xi − xm . That big pi-looking symbol means multiply all the terms. The example we did in class was with the points {(−2, −8),(−1, −1),(1, 1),(2, 8)}. So we will use the index i for the first point, 2 for the second, and 3 for the third. This means: i xi yi 1 −2 −8 2 −1 −1 3 1 1 4 2 8 When we compute the basis elements, we compute the following: • ℓ1(x) = x+1 −2+1  x−1 −2+1  x−2 −2−2  = − 1 12 (x 3 − 2x 2 − x + 2) • ℓ2(x) = x+2 −1+2  x−1 −1−1  x−8 −1−2  = 1 6 (x 3 − x 2 − 4x + 4) • ℓ3(x) = x+2 1+2  x+1 1+1  x−2 1−2  = − 1 6 (x 3 + x 2 − 4x − 4) • ℓ3(x) = x+2 2+2  x+1 2+1  x−1 2−1  = 1 12 (x 3 + 2x 2 − x − 2) To construct the Lagrange polynomial, we now multiply each basis polynomial by its corresponding yi value: L(x) = −8ℓ1(x)−1ℓ2(x) + 1ℓ3(x) + 2ℓ4(x) = x 3 We see that we get a degree 3 polynomial. Let’s check that it works with our points and even graph our points with the function −2 −1 1 2 −8 −1 1 8 x L(x) Now, I would like you to repeat the same procedure with the following points. 1. Find the cubic polynomial that passes through (0, 3),(−1, 2),(2, 11),(1, 4) using the method of Lagrange polynomials illustrated in the example above.

$25.00 View

[SOLVED] Math 240 — hw 1

1. Given the function f(x) = x 2 + 2x+ 1, estimate f ′ (2) using the points (1, 4) and (2, 9). The actual answer is 6–how close is your estimate? 2. For the function f(x) = sin(x), estimate f ′π 7  using the points π 6 ,sin(π 6 )  andπ 4 ,sin(π 4 )  . How good is your estimate? 3. For the function f(x) = √ x, estimate f ′ (0.5) using the points (0, 0) and (1, 1). How good is your estimate? 4. Using the table below for f(x), estimate f ′ (1.5). x f(x) 1 2 1.5 2.25 2 2.5

$25.00 View

[SOLVED] Math 240 — hw 5

Solve the following differential equations. 1. x ′ (t) = 2 sin(t), x(π) = 2 2. x ′ (t) = 3 cos(t), x(0) = 1 3. x ′ (t) = e −t , x(1) = 0 (try to write your answer in a nice form) 4. x ′ (t) = x, x(0) = 1 5. x ′ (t) = x 2 , x(0) = 1 6. x ′ (t) = xt, x(0) = 0 7. x ′ (t) = e −x , x(1) = 1 1

$25.00 View

[SOLVED] Cst 283 programming assignment 4

Objective This program provides an opportunity to practice use of two-dimensional arrays. Overview & Instructions Anticipating the inevitable zombie apocalypse, the government has challenged you with the task of creating a model that will describe how quick a group of zombies move from a starting point to cover a given area. The walking area can be seen as an n-by-n two-dimensional array. A number of zombies will start at the center. Each zombie individually can only make one step at a time to the left, right, up, or down (with an equal chance for any direction). Be sure to take into account the boundary cells to disallow zombines from leaving the area. You will need to “mark” the array cells visited by the zombies. Once marked, these stay marked even considering a zombie may return to the zone. An example scenario could be what you see below. Four zombies start in the middle. Each one can move in any direction. Note the locations of the zombies after 1 step and further with two steps. The gray cells are marked as visited. Since the movement of the zombies is random and there is an equal chance they could move in any direction (excluding out-of-bounds moves), this is only one of many scenarios. 4 1 1 1 2 1 Start After 1 Step After 2 Steps Your simulation input should include two variables: the number of zombies and the dimensions of the grid. These could be via program constants or as user input. The simple output of the simulation is to be the number of steps required to mark the entire grid area. Your program should help to formulate and test a hypothesis about the number of steps taken before all cells are touched. Run the program several times in order to report back to the government bosses with a summary of steps as a function of grid size and zombie count. Finally, include a feature that would allow someone (i.e. your instructor) to see your simulation to validate correctness. This does not imply the use of a graphical user interface, but instead could be a feature that could be enabled to send text messages to the console to show the step-by-step behavior of your zombies in motion.

$25.00 View

[SOLVED] Cst 283 programming assignment 2

Objective This program provides an opportunity to build a Java class and user interface to manage a simple dice game. Overview & Instructions Build a simple dice game with a JavaFX-based user interface. Choose a simple dice game or make up your own. One (of many) links for ideas would be: A classic programming challenge is the game of “Pig” but there are other similarly appropriate ideas. Or, feel free to make up your own game. You may anchor it as two-player or one-player (or either). There is a large degree of latitude in the game choice. These and similar decisions are up to you. Your solution should include two class files: First, include a front-end class with a basic user interface (text field(s), buttons, labels, etc.). Please use JavaFX Alert actions (instead of JOptionPane dialogs), if appropriate. Add buttons as needed to “roll”, “stop”, or “play again”. Be sure to include clear instructions and controls from a user’s perspective for starting, playing, and ending the game. Next, build a class to manage your game. This back-end class requires a more object oriented approach. Host all of the game data and actions behind-the-scenes in the game object. This implies that button clicks in the front-end driver will trigger method calls (get, set, etc.) to the object that defines the game rules, data, and behaviors. Finally here is already a large amount of Java code available on the web (or from previous semesters). Please be careful not to utilize existing game code that someone else has created. Deliverables Deliver the following to the online course management system Assignment dropbox: Upload your source code (.java) files Notice This is an individual assignment. You must complete this assignment on your own. You may not discuss your work in detail with anyone except the instructor. You may not acquire from any source (e.g., another student or an internet site), a partial or complete solution to a problem or project that has been assigned. You may not show another student your solution to an assignment. You may not have another person (current student, former student, tutor, friend, anyone) “walk you through” how to solve the assignment.

$25.00 View

[SOLVED] Cst 283 programming assignment 1

Objective This program provides an opportunity to practice Java files, String objects, and basic array searching. Overview & Instructions Write a program that will allow scientific queries to be performed on (actual) earthquake data. The (very large) file quakes.zip is provided and includes all earthquakes worldwide with magnitudes 4.0 (on Richter Scale) from 2010 through Summer 2018. The file format is: {date-time} {latitude} {longitude} {magnitude) {location} with data delimited by a pipe ( | ) character. A seismologist is requesting that an API (application program interface) be created to allow basic queries to be performed on the dataset with minimum keystrokes. Initially, read the entire contents of the data file to an array-based data structure. You can choose parallel arrays, a Java ArrayList, or an array of objects. You will then be be performing searches on the array(s). Your API will allow the user to key in a string into the program interface R,minLat,maxLat, minLon, maxLon D, minDate,maxDate M,minMag List all quakes in dataset by region with north/south boundary between minLat and maxLat, and east/west boundary between minLon and maxLon. List all quakes in dataset by date with the calendar date of the quake from minDate and maxDate. Include quakes from the minimum date through and including the maximum date. List all quakes in dataset with magnitude minMag or greater. Queries must be validated prior to processing. First, validate that the format matches one of the patterns above. This implies that each must begin with a character R, D, or M only. Next, be sure that the number of comma-delimited tokens match the expected pattern. Finally, be sure the data contained in each token are valid. Earthquake magnitudes must be 4.0 or greater. Latitudes must be -90.0 to 90.0 degrees. The minimum latitude would be the southern boundary. Longitudes can only be -180.0 to 180.0. The minimum longitude would be the western boundary. To validate the calendar dates, you have permission to use algorithms demonstrated in class. Along with two valid dates, be sure the first date is less than or equal to the second date. For any queries that do not match this format, provide an error message and allow the user to start again. Some valid sample queries could be: R,40.0,45.0,-90.0,-80.0 M, 6.2 D,2017-01-01,2017-12-31

$25.00 View