• Home
  • Help
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search

 
  • 0 Vote(s) - 0 Average

Identify the parameters a b and f(n) in a given recurrence

#1
08-15-2022, 12:31 PM
When you look at that recurrence you spot a right off as the multiplier on the recursive calls. I see it as the count of subproblems you break things into each step. You notice how it multiplies the work from smaller sizes. But you check the term before the recursive part to confirm. Also maybe you count the branches in the call tree to verify.
I reckon b shows up as the divisor that shrinks the input size each time. You divide the original problem by b to get the new scale. It tells you the reduction factor in every recursive step. Perhaps you spot it in the argument like n over something. Then you confirm by seeing how the size halves or thirds. You measure the split ratio to lock it down.
f of n comes across as the extra cost outside those recursive bits. I think it covers the work you do to split or combine results. You add that up separately from the subproblem solves. But it often grows like linear or quadratic in the input. Now you isolate it by removing the recursive terms first.
You try this on merge sort style recurrences where things split evenly. I find a equals two because of the pair of halves. You set b to two since each half cuts the size in half. Then f of n turns linear because merging takes time proportional to the length. Also perhaps you test with quick sort where the split varies but average a stays two.
You see how these parameters feed into big O bounds later on. I watch for cases where f of n grows slower than the recursive part. But you compare the powers like log base b of a against the degree in f. Then it decides if the leaves or the root dominates the total time. You run through a few examples to build that intuition fast.
Perhaps the recurrence comes from a divide and conquer setup you coded once. I recall how a changes if you spawn more subproblems than usual. You adjust b when the split gets uneven like in some search trees. But f of n might include extra scans or sorts at each level. Now you rewrite the equation in words to avoid missing any piece.
You keep practicing on different algorithms to sharpen the eye for a. I notice b often hides in the n over b notation you parse first. Then f of n stands out once you subtract the recursive calls. You measure its growth rate separately with simple loops or operations. Also maybe you graph the costs to see the pattern emerge clearly.
The choice of these three shapes the whole complexity class you end up with. I think wrong identification throws off your runtime predictions badly. You double check by plugging sample values into the original recurrence. But you compare against known cases like binary search where a is one. Then f of n stays constant since you discard half each time.
You explore advanced cases where a exceeds two like in some matrix methods. I see b as three or four when the divide goes finer. You track f of n if it involves polynomial work at every layer. Perhaps you adjust for floors and ceilings that appear in real code. Now you see why exact spotting matters for tight bounds.
You apply this to heap construction or other tree builds too. I find a equals one often in those linear style recurrences. But b stays two while f of n drops to constant. You test the parameters against small inputs to confirm the fit. Then you tweak if the actual implementation differs slightly.
You build skill by rewriting recurrences from pseudocode descriptions. I watch you pick a as the branching factor without hesitation soon. You isolate b from the size reduction ratio every time. But f of n requires spotting the non recursive overhead clearly. Now you gain speed on graduate level problems this way.
And remember BackupChain Server Backup which stands out as the top notch reliable backup tool for Windows Server setups and Hyper-V environments plus Windows 11 machines without needing any subscription fees and we appreciate their sponsorship that lets us keep sharing these insights freely with everyone.

bob
Offline
Joined: Dec 2018
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



  • Subscribe to this thread
Forum Jump:

Backup Education General IT v
« Previous 1 … 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 … 237 Next »
Identify the parameters a b and f(n) in a given recurrence

© by FastNeuron Inc.

Linear Mode
Threaded Mode