PROBLEM
Given:
- ๐1(๐) = ๐(๐1(๐))
- ๐2(๐) = ๐(๐2(๐))
Show that:
- ๐1(๐) +ย ๐2(๐) = ๐(๐๐๐ฅ(๐1(๐),๐2(๐)))
PROOF
- ๐1(๐) โค ๐1ยท๐1(๐) for allย ๐โฅ๐1ย # by definition of Big O notation
- ๐2(๐) โค ๐2ยท๐2(๐) for all ๐โฅ๐2ย # by definition of Big O notation
Let:
- ๐0 = ๐๐๐ฅ(๐1, ๐2)
Then, for all ๐โฅ๐0:
- ๐1(๐) +ย ๐2(๐)ย โค ๐1ยท๐1(๐) +ย ๐2ยท๐2(๐)
- ๐1(๐) +ย ๐2(๐)ย โค ๐1ยท๐๐๐ฅ(๐1(๐),๐2(๐)) + ๐2ยท๐๐๐ฅ(๐1(๐),๐2(๐))
- ๐1(๐) +ย ๐2(๐) โค (๐1ย + ๐2)ยท๐๐๐ฅ(๐1(๐),๐2(๐))
- ๐1(๐) +ย ๐2(๐) โค ๐ยท๐๐๐ฅ(๐1(๐),๐2(๐)) # ๐ = ๐1ย + ๐2
- ๐1(๐) +ย ๐2(๐) =ย ๐(๐๐๐ฅ(๐1(๐),๐2(๐))) # by definition of Big O notation