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ยท๐‘2ยท๐‘“1(๐‘›)ยท๐‘“2(๐‘›)
  • ๐‘”1(๐‘›)ยท๐‘”2(๐‘›) = ๐‘ยท๐‘“1(๐‘›)ยท๐‘“2(๐‘›) # ๐‘ =ย ๐‘1ยท๐‘2
  • ๐‘”1(๐‘›)ยท๐‘”2(๐‘›) =ย ๐‘‚(๐‘“1(๐‘›)ยท๐‘“2(๐‘›)) # by definition of Big O notation