Results 1 to 4 of 4

Thread: Log problem plus how to solve Big-omega & Big-O ?

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2006
    Posts
    3

    Log problem plus how to solve Big-omega & Big-O ?

    Dear vbforum

    I'm having trouble doing these question please help, I have try to do it, but I don’t know is right or not. Please any smart people out there, show me the step to do it.

    Thank You!

    VB Code:
    1. ----------------------Question
    2. Q1)Algorithm A uses 50n log n operations, algorithm B uses n^2 operations.
    3. Determine the value of n such that A this better than B for N >= n .
    4. Log(n) is base10 for A.
    5.  
    6. Q2)Suppose we are comparing implementations of insertion sort and merge sort on the same machine.
    7. For inputs of size n, insertion sort runs in 8(n^2), while merge sort runs in 64n lg n steps.
    8. For which values of n does insertion sort beat merge sort?
    9.  
    10. Q3)What is the smallest value of n such that an algorithm whose running time is 100 n2 runs faster than
    11. an algorithm whose running time is 2n on the same machine?
    12.  
    13. Q4)
    14. 2. Prove that f(x) = 10 + 100lg(x-3) is Big-omega
    15. 3. Prove that f(x) = 10 + 100lg(x-3) is Big-O
    16.  
    17. ----------------------
    18.  
    19. ----------------------Answer
    20. I don’t ready know what do it mean by A beat B, I hope I get the arrow right.
    21. Q1)
    22. A                B
    23. 50nlog(n) <= n^2
    24.  
    25. 50nlog(n) <= n^2
    26. ----------  ----
    27. n             n
    28.  
    29. 50log(n) <= n
    30.  
    31. n=1 try it out
    32. 50log(1) <= 1
    33. 0 <= 1
    34. 0<=n<=1
    35.  
    36.  
    37.  
    38.  
    39. Q2)
    40. 8n^2 >= 64nlgn
    41.  
    42. 8n^2 >= 64nlgn
    43. ------  --------
    44. n          n
    45.  
    46. 8n >= 64lgn
    47.  
    48. 8n >= 64lgn
    49. ----   --------
    50. 8         8
    51.  
    52. n >= 8lgn
    53.  
    54. n >= lg(n^8)
    55.  
    56. 2^n >= n^8
    57.  
    58. Try to guess
    59.  
    60. n = 0
    61. 2^0 >= 0^8
    62. 1 >= 0 Yes
    63.  
    64. n=1
    65. 2^1 >= 1^8
    66. 2 >= 1 Yes
    67.  
    68. n=2
    69. 2^2 >=2^8
    70. 4 >= 256 No
    71.  
    72. I think 0 <= n <= 1
    73.  
    74.  
    75.  
    76. Q3)
    77. 100n^2 <= 2^n
    78.  
    79. Don’t know what to do, try to guess
    80. n = 1/10
    81. 100(1/10)^2 <= 2^(1/10)
    82. 100(1/100)^2 <= 2^(1/10)
    83. 1 <= 2^(1/10)
    84. 1 <= 1.07
    85. 0 <= n <= 1/10
    86.  
    87. Q4) No Idea, can some one please show step for Big-omega & Big-O?
    88.  
    89. ----------------------
    Please help.
    Last edited by someone_259@hotmail; May 30th, 2006 at 10:16 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width