It is important to consider the effect of thermal expansion when building a structure that must withstand changes in temperature. For example a metal beam will expand in hot temperatures. The additional stress could cause the structure to fail. Similarly, a material will contract in cold temperatures. The linear change in length of a material if it is allowed to freely expand is described by the following equation:
L∆ = aL0T∆
Here, L0 is the initial length of the material in meters, L∆ is the displacement in meters, T∆ is the change in temperature in Celsius, and a is a coefficient for linear expansion.
Write a
Want to see the full answer?
Check out a sample textbook solutionChapter 2 Solutions
Java: An Introduction to Problem Solving and Programming (7th Edition)
Additional Engineering Textbook Solutions
Concepts Of Programming Languages
Starting Out with C++: Early Objects
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Modern Database Management (12th Edition)
Introduction To Programming Using Visual Basic (11th Edition)
Computer Systems: A Programmer's Perspective (3rd Edition)
- In a hypothetical study of population dynamics, scientists have been tracking the number of rabbits and foxes on an island. The number of rabbits and foxes are determined once a year using high resolution infrared cameras and advanced computer vision methods.Each year, the number of rabbits and foxes are found to change by the following equations: $$ {\Delta}R = round( kr*R - krf*R*F ) $$ $$ {\Delta}F = round( -kf*F + kfr*R*F ) $$ where $ {\Delta}r $ and $ {\Delta} f $ are the changes in number of rabbits and foxes by the end of that year; and R and F are the population sizes at the end of the previous year. kr, krf, kf, kfr are coefficients that depend on the species of rabbits and foxes.With these dynamics, the scientists realize that one or both species can become extinct on the island. At the end of each year, if there are fewer than 2 animals of a kind, the scientists transfer rabbits and/or foxes to make sure there are at least 2 of each kind.Write a function…arrow_forwardConsider the problem of making change for n cents using the fewest number of coins. Assume that we live in a country where coins come in k dierent denominations c1, c2, . . . , ck, such that the coin values are positive integers, k ≥ 1, and c1 = 1, i.e., there are pennies, so there is a solution for every value of n. For example, in case of the US coins, k = 4, c1 = 1, c2 = 5, c3 = 10, c4 = 25, i.e., there are pennies, nickels, dimes, and quarters. To give optimal change in the US for n cents, it is sufficient to pick as many quarters as possible, then as many dimes as possible, then as many nickels as possible, and nally give the rest in pennies. Design a bottom-up (non-recursive) O(nk)-time algorithm that makes change for any set of k different coin denominations. Write down the pseudocode and analyze its running time. Argue why your choice of the array and the order in which you fill in the values is the correct one. Notice how it is a lot easier to analyze the running time of…arrow_forwardConsider the problem of making change for n cents using the fewest number of coins. Assume that we live in a country where coins come in k dierent denominations c1, c2, . . . , ck, such that the coin values are positive integers, k ≥ 1, and c1 = 1, i.e., there are pennies, so there is a solution for every value of n. For example, in case of the US coins, k = 4, c1 = 1, c2 = 5, c3 = 10, c4 = 25, i.e., there are pennies, nickels, dimes, and quarters. To give optimal change in the US for n cents, it is sufficient to pick as many quarters as possible, then as many dimes as possible, then as many nickels as possible, and nally give the rest in pennies. Design a bottom-up (non-recursive) O(nk)-time algorithm that makes change for any set of k different coin denominations. Write down the pseudocode and analyze its running time. Argue why your choice of the array and the order in which you ll in the values is the correct one.arrow_forward
- Consider the problem of making change for n cents using the fewest number of coins. Assume that we live in a country where coins come in k dierent denominations c1, c2, . . . , ck, such that the coin values are positive integers, k ≥ 1, and c1 = 1, i.e., there are pennies, so there is a solution for every value of n. For example, in case of the US coins, k = 4, c1 = 1, c2 = 5, c3 = 10, c4 = 25, i.e., there are pennies, nickels, dimes, and quarters. To give optimal change in the US for n cents, it is sufficient to pick as many quarters as possible, then as many dimes as possible, then as many nickels as possible, and nally give the rest in pennies. Prove that the coin changing problem exhibits optimal substructure. Design a recursive backtracking (brute-force) algorithm that returns the minimum number of coins needed to make change for n cents for any set of k different coin denominations. Write down the pseudocode and prove that your algorithm is correct.arrow_forwardImagine there are N teams competing in a tournament, and that each team plays each of the other teams once. If a tournament were to take place, it should be demonstrated (using an example) that every team would lose to at least one other team in the tournament.arrow_forwardSuppose for an international football tournament, you wish to find the probability of the country who can win the final game. You can find the odds for winning from your local bookie [A bookie sets odds, accepts and places bets, and pays out winnings on behalf of other people]. Odds are mathematically treated as a fraction. If the odds for the Morocco vs Argentina game are 5 to 1, the fraction is 1 / 5. So to convert the fraction into probability of winning, take the numerator and divide it by the denominator plus 1. Use the Frac.class in Java to help you convert any given odds into probability. Display your result as a percentage on you console.arrow_forward
- We now consider two sound waves with different frequencies which have to the same amplitude. The wave functions of these waves are as follows: y1 (t) = A sin (2πf1t) y2 (t) = A sin (2πf2t) 1) Using any computer program, construct the wave dependency graph resultant y (t) from time t in the case when the frequencies of the two sound waves are many next to each other if the values are given: A = 1 m, f1 = 1000 Hz and f2 = 1050 Hz. Doing the corresponding numerical simulations show what happens with the increase of the difference between the frequencies of the two waves and vice versa.arrow_forwardYou and your friends decided to hold a “Secret Santa” gift exchange, where each person buys a gift for someone else. To see how this whole thing works, let’s consider the following example. Suppose there are 7 people A, B, C, D, E, F, and G. We denote x → y to mean “x gives a gift to y.” If the gift exchange starts with person A, then they give a gift to E. Then E gives a gift to B. And it is entirely possible that B gives a gift to A; in such a case we have completed a “cycle.” In case a cycle occurs, the gift exchange resumes with another person that hasn’t given their gift yet. If the gift exchange resumes with person D, then they give a gift to G. Then G gives a gift to F. Then F gives a gift to C. Then finally C gives a gift to D, which completes another cycle. Since all of the people have given their gifts, the giftexchange is done, otherwise the gift exchange resumes again with another person. All in all, there are two cycles that occurred during the gift exchange: A → E → B → A…arrow_forwardSimplify the following Boolean function , using three- variable maps: a) F(x,y,z) = Σ (0,2,6,7) b) F(A,B,C ) = Σ (0,2,3,4,6) c) F(a,b,c) = Σ (0,1,2,3,7) d) F(x,y,z) = Σ (3,5,6,7)arrow_forward
- Consider the following for loops in R. For each for loop, list the values (in order) that the variable i takes on in the body of the loop. Briefly (in no more than a few sentences) explain why. a) for(i in 1+2:3.4*5) { } b) for(i in dim(matrix(0, nr = 7, nc = 8))) { } c) for(i in rnorm(3)) { } d) for(i in iris[1:3,3]) { } e) for(j in c(1, 2, 3, 4, 5)) { } f) for(i in (function(x) x*x)(c(1, 2, 3))) { } g) for(i in NULL) { } h) for(i in strsplit(as.character(4*atan(1)),’’) [[1]][1:10]) { }arrow_forwardIn python 3 We all know that when the temperature of a metal increases, it begins to expand. So,we experimented with exposing a metal rod to different temperatures and recorded itslength as follows:Temp 20 25 30 35 40 45 50 55 60 65Length 0.5 1.8 5 6 6.2 6.5 7.8 9.4 9.8 10.9 Now do these requirments: 1) Implement and plot a simple linear regression for the above data, where the temperature is “x”, and the length is “y” 2) Implement and plot a multiple linear regression "Polynomial regression" with different degrees.For example, Degree of 3:Y = w1x1 + w2x2 + w3x3 + w4Where w4 represents bias.*you can use a normal equation to calculate ‘W’ as follow:W = (XT.X)-1.(XT.Y)Then calculate Y, Where Y = X.WT 3) Try degrees of 2, 3, 5, and 8arrow_forwardA standard science experiment is to drop a ball and see how high it bounces. Once the “bounciness” of the ball has been determined, the ratio gives a bounciness index. For example, if a ball dropped from a height of 10 feet bounces 6 feet high, the index is 0.6, and the total distance traveled by the ball is 16 feet after one bounce. If the ball were to continue bouncing, the distance after two bounces would be 10 ft + 6 ft +6 ft + 3.6 ft = 25.6 ft. Note that the distance traveled for each successive bounce is the distance to the floor plus 0.6 of that distance as the ball comes back up. Write a program that lets the user enter the initial height from which the ball is dropped, the bounciness index, and the number of times the ball is allowed to continue bouncing. Output should be the total distance traveled by the ball. Below is an example of the program input and output: Enter the height from which the ball is dropped: 25 Enter the bounciness index of the ball: .5 Enter the number of…arrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningOperations Research : Applications and AlgorithmsComputer ScienceISBN:9780534380588Author:Wayne L. WinstonPublisher:Brooks Cole