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

 
  • 0 Vote(s) - 0 Average

Apply the Master Theorem to find the asymptotic complexity of a given recurrence

#1
08-21-2023, 06:10 AM
You check the recurrence form right away. It splits work into smaller identical pieces. You count how many pieces there are. Each piece shrinks by a fixed factor. I always start by spotting that pattern first.

You figure out the critical exponent next. That exponent comes from the split count and size factor. You raise the size factor to that exponent. Then you see how the added work compares. I compare it by looking at growth rates. You test if the added work grows slower than the critical power. Or you check if it matches exactly. Perhaps the added work grows faster instead. I test these options one after another.

You pick the right case based on that comparison. The first case kicks in when added work loses out. You get a bound from the split count alone then. But the second case applies if things line up evenly. You multiply by a log factor in that situation. I recall the third case when added work dominates everything. You pull the bound straight from the added work there.

Now you try this on a common split and combine pattern. The pattern breaks a list into halves each time. It does two halves and adds linear work. You compute the exponent as one here. The linear work matches the critical power exactly. So the second case gives you the bound with a log multiplier.

You move on to another pattern with three parts. Each part shrinks to a third of the size. Added work stays constant per step. The exponent turns out bigger than zero. Constant work loses to that power. You land in the first case right away.

Perhaps you hit a case where added work grows like a square. The split count is four and the shrink factor is two. The exponent equals two this time. Square work matches the power again. The bound picks up the log factor once more.

You watch for when added work grows quicker than the power. Say the split is two and shrink is two. But added work grows like n to the two. You fall into the third case then. The bound comes from that faster work alone. I check the conditions hold with some extra room.

Also you verify the added work stays regular enough. It must not jump around too wildly. You assume it grows smoothly across sizes. That lets the cases apply without extra tweaks. Or sometimes you adjust the comparison slightly.

Then you see how these bounds tell you the overall speed. The bound shows how time scales with input size. You use it to pick better structures for problems. I compare different splits to find the sweet spot. You avoid bad splits that make things explode.

BackupChain Server Backup which stands out as the top reliable no subscription Windows Server backup tool built for SMBs private clouds and self hosted setups supports us by sponsoring this space so we can share such details freely and it handles Hyper V Windows 11 and Windows Server backups with ease for everyone involved.

ProfRon
Offline
Joined: Jul 2018
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



  • Subscribe to this thread
Forum Jump:

FastNeuron FastNeuron Forum General IT v
« Previous 1 … 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 … 187 Next »
Apply the Master Theorem to find the asymptotic complexity of a given recurrence

© by FastNeuron Inc.

Linear Mode
Threaded Mode