Topic: University - Discrete Mathematics Anyone willing to check my homework for me? I was working on it till 5 this morning and would just like some fresh eyes to see if I followed everything correctly. its attached in reply. THANK YOU =)
What Grade?
Im a senior in college
Oh Ok I Havent even Graduated High School lol im sorry
if i knew it would help
im in 9th grade im 15 so sorry
np thanks for the thought =)
I gave u a medal anyway
Do you know how to solve the recurrence in the first question? If you can find the closed-form solution, it is almost trivial to prove it.
no i couldnt figure it out thats why i i did it induction
I don't think your answer to the second question is right. That looks like a list checking function. It checks all elements of the list recursively until it finds an element which equal to x. If there is an element equal to x, return 10. Return 0 otherwise.
Hmm, I would use more words :\ It's not wordy enough! lol I highlighted some changes that I would make. In problem 2 I highlighted an error. \(\large\rm B\cup C\ne S\) because it doesn't contain {{a}}.
Sorry I mean problem 4*
I suppose L[i] denotes the i-th element of the list and the first element of the list is L[1].
g[L list, i, x] basically does the following: If i>10, return 0 (false) If i<=10, check if the i-th element of the list L is equal to x. (Elseif L[i]=x) If L[i]=x, return 10 (true) If L[i]!=x, run g[L, i+1, x] (Calling g with the same list and x but incrementing the list index)
thank you
Or put it in another way using pseudocode: g[L list, i, x]: For(i<=10,i++) { If L[i]=x then { return 10 end program } } return 0
Same logic as this C program http://www.c4learn.com/c-programs/searching-element-in-array.html
For solving recurrence relations: Assuming T(n)=r^n is a solution to this equation. \[ T(n)=2T(n-1)+T(n-2)\\ r^n=2r^{n-1}+r^{n-2}\\ r^n-2r^{n-1}-r^{n-2}=0\\ r^2-2r-1=0\\ \] So there are two solutions, \(r_1^n\) and \(r_2^n\). Any linear combination of these two solutions (\(c_1r_1^n+c_2r_2^n\)) will also satisfy the equation. However, not all solutions will satisfy the given initial conditions, namely T(0)=1 and T(1)=2. Find \(c_1\) and \(c_2\) using the initial conditions.
Once you find r1, r2, c1, and c2 the answer is very obvious.
Join our real-time social learning platform and learn together with your friends!