北美代写,Homework代写,Essay代寫-准时✔️高质✔最【靠谱】

HW4, due Wednesday, Aug. 4
時間: 2021-08-07 07:54:18

北美代写,Homework代写,Essay代寫-准时✔️高质✔最【靠谱】Part I. 1. Plot the wave beats with the following parameters and estimate the periods for the envelope and carrier waves. E0=3; w=15; dw=1; f[t_]=2 E0 Cos[dw t] Cos[ w t]; Plot[f[t], {t, -2, 7}] 2. Run the partial sums for the following six trigonometric series and answer the following questions. a) Show the plot for N1=64; b) What is the period of the resulting function? c) Are there overshoots or undershoots and if there are do the decays in amplitude? d) Is the resulting function seem to be continuous, discontinuous, is its first derivative continuous or discontinuous? e) How the coefficients decay in terms of the index k, e.g. 1/k, 1/k^2, exp(-k^2), etc.? You may use the following two Mathematica commands for this problem: ----------------------------------------------------------------------------------------------------------------- (* Ex 1. *) f[x_, N1_] := 1/2 + 2/Pi Sum[ Sin[Pi n x ]/n , {n, 1, N1, 2}]; (*n=1, 3, 5,…*) Plot[f[x, 16], {x, -2,4}}, PlotRange -> All] (* Uncomment manipulate if you wish to use it *) (* step from 16 by 16 increments to 256, use whatever you find informative *) (* Manipulate[Plot[f[x, N1], {x, -.1, .1}}, PlotRange -> All], {N1, 16, 256, 16}] *) ----------------------------------------------------------------------------------------------------------------------- (*Ex2. by default n=1,2,3,..*) f[x_,N1_]:=Pi^2/3+ 4 Sum[(-1)^n Cos[ n x]/n^2,{n,1,N1}]; Plot[f[x,16],{x,-10,10}}, PlotRange -> All] (* Manipulate[Plot[f[x, N1], {x, -6, 7}}, PlotRange -> All], {N1, 16, 256, 16}] *) --------------------------------------------------------------------------------------- 2 2 4 6 6 4 2 2 4 6 (* Ex3. *) f[x_,N1_]:=4/Pi Sum[(-1)^n Cos[ n x]/n^2,{n,1,N1,2}];(*Ex3. by n=1,,3, 5..*) Plot[f[x,16],{x,-10,10}] (* Manipulate[Plot[f[x, N1], {x, -10,10}}, PlotRange -> All], {N1, 16, 256, 16}] *) ---------------------------------------------------------------------------------------- (*Ex. 4 *) f[x_, N1_] := Sum[ Cos[ n x], {n, 1, N1}]; Plot[f[x, 16], {x, -1, 1}, PlotRange -> All] Plot[f[x, 256], {x, -.1, .1}, PlotRange -> All] (* Manipulate[ Plot[f[x, N1], {x, -.2, 0.2}, PlotRange -> All], {N1, 16, 256, 16}] *) ------------------------------------------------------------------------------------------------------ (*Ex. 5 *) f[x_, N1_] := 2/Pi Sum[(Cos[Pi n/2] - Cos[Pi n] ) Sin[ n x]/n, {n, 1, N1}]; Plot[f[x, 32], {x, -5, 10}, PlotRange -> All] (* Manipulate[ Plot[f[x, N1], {x, 0, 5}, PlotRange -> All], {N1, 16, 256, 16}] *) -------------------------------------------------------------------------------------------------- (*Ex. 6 *) L=2; sig=0.2; f[x_,N1_]:=Sqrt[Pi]/sig/( 2 L) Sum[Exp[-n^2/(2 L/(Pi sig)) ^2] Exp[I (Pi /L) n x],{n,-N1/2,N1/2,1}]; Plot[Abs[f[x,10]],{x,-2,2}, PlotRange->All] Plot[Abs[f[x,16]],{x,-2,2}, PlotRange->All] (* Manipulate[ Plot[f[x, N1], {x, -2, 2}, PlotRange -> All], {N1, 8, 64, 8}] *) ------------------------------------------------------------------------------------------------------- Part II 1. Estimate decay of the Fourier coefficients from A) analytic computation and B) illustrate it graphically for the following three functions. (Uncomment them one at a time.) ClearAll; L=Pi; g[x_]=Piecewise[{{x^3,-Pi<x<pi}}]; (*="" g[x_]="Piecewise[{{1,-Pi<x<0},{0," 0<xAll]*) (* Check values of g[x] at the end point N[g[Pi]] to make sure that integration can be taken from –Inf to +Inf for this function *) a[k_]=1/L Integrate[g[x] Cos[Pi/L k x],{x,-L,L}] ; (* 1/L Integrate[g[x] Cos[Pi/L k x],{x,-Inf, Inf}] ; for Gauusian example *) b[k_]=1/L Integrate[g[x] Sin[Pi/L k x],{x,-L,L}] ; (* Or identically, can use MATHEMATICA command for c[k] called FourierCoefficient and use relations a[k_]=2 Re[c[k], b[k]=-2 Im[c[k] *) (*Plot a[k] and b[k] first to see if the next command will make sense, e.g. are the coefficients nonzero? e.g. check before the next command ListPlot[a[k], {k,0,N1}], ListPlot[b[k], {k,1,N1}] *) ListPlot[Table[{Log[k], Log[Abs[a[k]]]}, {k, 2, 15}]] (* To see the decay rate of the Fourier Coefficients *) L = Pi; a[0] = 1/L Integrate[g[x] , {x, -L, L}] ; a[k_] = Expand[ 1/L Integrate[g[x] Cos[Pi/L k x], {x, -L, L}] ] b[k_] = Expand[ 1/L Integrate[g[x] Sin[Pi/L k x], {x, -L, L}] ] ListPlot[Table[{Log[k], Log[Abs[b[k]]]}, {k, 2, 15}]] (* or equivalently, ListLogLogPlot [Table[{k, Abs[b[k]]}, {k, 2, 15}] ]; *) (* Change LogLog plot to appropriate plot for the Gaussian Exp[-k^2] to see a straight line *) ------------------------------------------------------------------------------------------------------------------------- Part III 1. For the previous three functions A) Plot partial sums for N1 = 64, B) Plot the error for N1=64, C) What is the theoretical expected decay rate of the error as function of N1? For example, run the following commands for each of the three cases. g[x_]=Piecewise[{{x^3,-Pi<x{Red, Blue}] dx = 0.2; Plot[{Evaluate[g[x] - SN[x, 64]]}, {x, -Pi + dx, Pi - dx}, PlotRange -> All] 

CSc 345: Homework Assignment 4
時間: 2021-08-06 08:13:02

北美代写,Homework代写,Essay代寫-准时✔️高质✔最【靠谱】Assigned: Monday July 26 2021 Due: 5:00PM, Friday August 6 2021 Clear, neat and concise solutions are required in order to receive full credit so revise your work carefully before submission, and consider how your work is presented. If you cannot solve a particular problem, state this clearly in your write-up, and write down only what you know to be correct. For involved proofs, first outline the argument and then delve into the details. 1. (10pts) Give a θ(n)-time nonrecursive procedure that reverses a singly linked list of n elements. The procedure should use no more than constant storage beyond that needed for the list itself. 2. (10pts) Suppose that we are storing a set of n keys into a hash table of size m. Show that if the keys are drawn from a universe U with |U| > nm, then U has a subset of size n consisting of keys that all hash to the same slot, so that the worst-case searching time for hashing with chaining is θ(n). 3. (10pts) What is the difference between the binary-search-tree property and the min-heap property (see page 153)? Can the min-heap property be used to print out the keys of an n-node tree in sorted order in O(n) time? Show how, or explain why not. 4. (10pts) Write the TREE-PREDECESSOR procedure. 5. (10pts) Consider a binary search tree T whose keys are distinct. Show that if the right subtree of a node x in T is empty and x has a successor y, then y is the lowest ancestor of x whose left child is also an ancestor of x. (Recall that every node is its own ancestor.) 6. (10pts) An alternative method of performing an inorder tree walk of an n-node binary search tree finds the minimum element in the tree by calling TREE-MINIMUM and then making n ? 1 calls to TREE-SUCCESSOR. Prove that this algorithm runs in θ(n) time. 7. (10pts) We can sort a given set of n numbers by first building a binary search tree containing these numbers (using TREE-INSERT repeatedly to insert the numbers one by one) and then printing the numbers by an inorder tree walk. What are the worst-case and best-case running times for this sorting algorithm? 1 8. (10pts) Given an adjacency-list representation of a directed graph, how long does it take to compute the out-degree of every vertex? How long does it take to compute the in-degrees? 9. (10pts) Let (u, v) be a minimum-weight edge in a connected graph G. Show that (u, v) belongs to some minimum spanning tree of G. 10. (10pts) Prove that if G is an undirected bipartite graph with an odd number of vertices, then G is nonhamiltonian.

在線客服

售前咨詢
售后咨詢
微信號
Essay_Cheery
微信
墨尔本assignment代写,代写毕业论文,paper代写-51作业君 北美代写,程序代做,程序代写,java代写,python代写,c++代写,c代写 英国代写paper,python代写,Report代写,编程代写-程序代写网 北美代写essay,程序代写,Java代写代做,Java代考-焦点论文 澳大利亚essay代写,编程代写,代码代写,程序代写-三洋编程 加拿大essay代写|程序代写代做||Python代写|Matlab代写-Meeloun 澳大利亚代写,代写essay,代写毕业论文,留学生代写-小马代写 日本代写,北美作业代写,新加坡代写,essay代写-无时差服务 加拿大代写,作业代写,exam代考,Report代写,代写文章-最靠谱最低价 新加坡代写,北美CS代写,python代写,CS编程代写-新顾客立减20%