Is this allowed in substitution

In summary, Homework Statement: The Attempt at a Solution states that f(k-1) = 2[2f(2k-2)*2k-1-1] + 2k - 1where k-1 is the guess. The TA way states that She did the same thing I did but in the part where we have = 4(f(2k-2) * (2*2k) - 3she put = 4(f(2k-2) * (2*2k) + 22
  • #1
Ad2d
9
0

Homework Statement


I have recurrence relation problem and what to ask would my way be just as correct as the TA did the solution:

f(n) = 0, n=1 and 2f(n/2) + n -1

The Attempt at a Solution



Here we assume n = 2k

This is my way:

f(k-1) = 2[2f(2k-2)*2k-1-1] + 2k - 1

= 4(f(2k-2) * (2*2k) - 3
:
:
= 2j*f(2k-j) + j2k - (j-1)

Guess: j=k
2j*f(2j-j) + j2j - (j-1)
2jf(1)+ j2j - (j-1)

j2j - (j-1) = j2j - j + 1 = j(2j)

The TA way

She did the same thing I did but in the part where we have
= 4(f(2k-2) * (2*2k) - 3

she put

= 4(f(2k-2) * (2*2k) - 22 + 1

where my guess came to be j(2j) she gets 2j(j-1) +1

Is her way correct where instead of putting the -3 she put the -22 + 1 ?
 
Last edited:
Physics news on Phys.org
  • #2
f(n) = 0, n=1 and 2f(n/2) + n -1

I don't understand what you wrote. Can you rephrase? I fail to see the "recurrence".
 
  • #3
Ad2d said:

Homework Statement


I have recurrence relation problem and what to ask would my way be just as correct as the TA did the solution:

f(n) = 0, n=1 and 2f(n/2) + n -1
Do you mean f(n)= 2f(n/2)+ n- 1?

The Attempt at a Solution



Here we assume n = 2k

This is my way:

f(k-1) = 2[2f(2k-2)*2k-1-1] + 2k - 1
Why k-1? If n= ek, tnen f(n)= f(2k-1). How did you reduce it to "f(k-1)"? Putting n= 2k would give n/2= 2k-1. Is that what you meant?
Are you relabeling f(n)= f(2k) as f(k)? That can be done but you must say so: and it would be better to use a different symbol as you now have a different function: let g(k)= f(2[/sup]k[/sup]). And, of course, since most natural numbers are NOT powers of 2, letting k be a natural number will not give all values of n.

= 4(f(2k-2) * (2*2k) - 3
:
:
= 2j*f(2k-j) + j2k - (j-1)

Guess: j=k
2j*f(2j-j) + j2j - (j-1)
2jf(1)+ j2j - (j-1)

j2j - (j-1) = j2j - j + 1 = j(2j)

The TA way

She did the same thing I did but in the part where we have
= 4(f(2k-2) * (2*2k) - 3

she put

= 4(f(2k-2) * (2*2k) - 22 + 1

where my guess came to be j(2j) she gets 2j(j-1) +1

Is her way correct where instead of putting the -3 she put the -22 + 1 ?
 
  • #4
Sorry for the confusion. You right when you stated that when n=2k that f(n/2) becomes f(2k/2) which goes to f(2k-1).

For the f(n-1) I may have skipped a step when substitution. I meant to say:
f(k) =2f(2k-1). + 2k -1

then after that I started my substitution. My qeustion was that when I did my first subsititution I got: 4(f(2k-2) * (2*2k) - 3 where the TA got 4(f(2k-2) * (2*2k) - 22 + 1


I mean naturally - 22 + 1 = -3 but can you do that in substitution? It seems like you are forcing the problem.

Also, you are right that if "letting k be a natural number will not give all values of n". The reason, I believe, that we are letting that happen is because this is a merge sort recursion (sorry again, did not realize that I post in my first post) and that you what any size list that is going into merge sort to be divide fairly even. I do not know why, but professor could have but the floor symbol or ceiling symbol on the n/2 and that would do it.
 

FAQ: Is this allowed in substitution

Is it always necessary to substitute a variable or value in a scientific experiment?

No, substitution is not always necessary in a scientific experiment. It depends on the specific experiment and what the researcher is trying to achieve. Substitution is typically used when there is a need to replace a variable with a specific value in order to observe its effect on the overall experiment.

What are some common reasons for using substitution in a scientific experiment?

Substitution is commonly used to control for certain variables in an experiment, to test a specific hypothesis, or to manipulate certain conditions in order to observe their effects on the overall results. It can also be used to simplify complex equations or to make calculations more manageable.

Are there any limitations or drawbacks to using substitution in a scientific experiment?

Yes, there can be limitations and drawbacks to using substitution in a scientific experiment. For example, if the substituted value is not accurate or does not accurately represent the variable being replaced, it can lead to inaccurate results. Additionally, if too many variables are substituted, it can make it difficult to draw meaningful conclusions from the experiment.

What are some best practices for using substitution in a scientific experiment?

Some best practices for using substitution in a scientific experiment include carefully selecting the value to be substituted, ensuring that it accurately represents the variable being replaced, and limiting the number of substitutions to only those that are necessary. It is also important to clearly document any substitutions made and to carefully analyze the results to ensure they are valid.

How can I determine if substitution is appropriate for my experiment?

The appropriateness of using substitution in a scientific experiment can vary depending on the specific experiment and the goals of the researcher. It is important to carefully consider the potential effects of substitution on the results and to consult with other scientists or experts in the field if needed. Ultimately, the decision to use substitution should be based on the goals of the experiment and the accuracy and validity of the substituted value.

Back
Top