Recent content by DrAlexMV
-
D
Calculating number of steps in multiple loop piece of code
This is much more abstract than that. For i = 1, 2, ..., n For j = i + 1, i + 2, ..., n Add up array entries A[i] through A[j] Store the result in B[i, j] Endfor Endfor For example, the outer loop: For i = 1, 2, ..., n Runs n times The second loop: For j = i + 1, i + 2, ..., n...- DrAlexMV
- Post #9
- Forum: Engineering and Comp Sci Homework Help
-
D
Calculating number of steps in multiple loop piece of code
The T(n) for the stackoverflow post is the one for this particular exercise. It does not relate to the asymptotic bounds, but to the exact number of steps. With this T(n) you can calculate any asymptotic bound.- DrAlexMV
- Post #7
- Forum: Engineering and Comp Sci Homework Help
-
D
Calculating number of steps in multiple loop piece of code
So how should I approach this problem? I need to know the T(n) so I can derive the best-case estimate for this algorithm.- DrAlexMV
- Post #5
- Forum: Engineering and Comp Sci Homework Help
-
D
Calculating number of steps in multiple loop piece of code
It should, but this algorithm comes from the book.- DrAlexMV
- Post #3
- Forum: Engineering and Comp Sci Homework Help
-
D
Calculating number of steps in multiple loop piece of code
Homework Statement The following pseudocode demonstrates an algorithm to create a 2D array from a 1D array by adding elements into certain rows: For i = 1, 2, ..., n For j = i + 1, i + 2, ..., n Add up array entries A[i] through A[j] Store the result in B[i, j] Endfor...- DrAlexMV
- Thread
- Code Loop Multiple
- Replies: 11
- Forum: Engineering and Comp Sci Homework Help
-
D
How to Find the Volume of a Rotating Solid?
Homework Statement Region: f(x) = 2 sin x on the interval [0, π]. Find the volume of the 3D solid obtained by rotating this region about the dashed line y = −1. Homework Equations Integration of pi∫(2sin(x) + 1)^2 dx The Attempt at a Solution...- DrAlexMV
- Thread
- Rotating Solid Volume
- Replies: 1
- Forum: Calculus and Beyond Homework Help
-
D
Efficient Algorithm for Solving CNF/DNF Logic Problem with 9 Input Literals
Disjunctive normal form and Conjunctive normal form- DrAlexMV
- Post #3
- Forum: Calculus and Beyond Homework Help
-
D
Efficient Algorithm for Solving CNF/DNF Logic Problem with 9 Input Literals
Homework Statement There exists a function f. Assume that you are given f's CNF representation and f's DNF representation. The CNF representation has some number of clauses, and each clause has 3 literals. The DNF representation has some number of terms where each term has 3 literals. The...- DrAlexMV
- Thread
- Logic
- Replies: 2
- Forum: Calculus and Beyond Homework Help
-
D
Probability Midterm Question: Fruit row counting
I am actually not sure how to combine these without counting things more twice. Could you aid me through that?- DrAlexMV
- Post #5
- Forum: Calculus and Beyond Homework Help
-
D
Probability Midterm Question: Fruit row counting
^ 8!2!2! Right?- DrAlexMV
- Post #3
- Forum: Calculus and Beyond Homework Help
-
D
Probability Midterm Question: Fruit row counting
Homework Statement You have 10 pieces of fruits of which 1 is an orange, 1 is an apple, 1 is a pear, and 1 is a peach. How many ways are there to organize them in a row if the apples and oranges must be together and the pears and peaches cannot be together. Homework Equations Mostly...- DrAlexMV
- Thread
- Counting Midterm Probability Row
- Replies: 5
- Forum: Calculus and Beyond Homework Help
-
D
Undergrad Solving a 5-Digit Probability Problem Using Combinations
Could you elaborate on what you mean by "one or two pairs the same, etc"?- DrAlexMV
- Post #3
- Forum: Set Theory, Logic, Probability, Statistics
-
D
Undergrad Solving a 5-Digit Probability Problem Using Combinations
Problem Statement: How many 5 digit number can be formed from the integers 1,2, ..., 9 if no digit can appear more than twice? Approach: 18!/((2!*9)(18-5)!) Reason: Using the combination formula, we were able to approach this problem by saying that there are 18...- DrAlexMV
- Thread
- Probability
- Replies: 3
- Forum: Set Theory, Logic, Probability, Statistics
-
D
Proof: a/b + b/a is Int iff a=b
Yes, I saw that whenever you told me to prove that p|b. Thank you a lot, this proof really made me think for some reason.- DrAlexMV
- Post #21
- Forum: Calculus and Beyond Homework Help
-
D
Proof: a/b + b/a is Int iff a=b
Would this work? a^2 + b^2 = pj where j is an element of the integers a = pw where w is an element of the integers Then: p^2w^2 + b^2 = pj we reorganize to: b^2 = p(j - pw^2) we let j - pw^2 = v where v is an element of the integers so b^2 = pv that implies p|b^2...- DrAlexMV
- Post #19
- Forum: Calculus and Beyond Homework Help