Help with Logarithms: Binary Searches & Phone Books

  • Thread starter Thread starter lokisapocalypse
  • Start date Start date
  • Tags Tags
    Logarithms
Click For Summary
A binary search of x items requires at most log base 2 (x) searches in sorted data. When using a phone book with y names across z pages, the search process changes to first finding the page, requiring log base 2 (y) searches, followed by finding the name on that page, which takes log base 2 (z) searches. The total number of searches becomes log base 2 (y) + log base 2 (z). This aligns with the logarithmic product rule, confirming that log base 2 (x) equals log base 2 (y) + log base 2 (z) when x = y*z. The discussion clarifies the application of logarithmic properties in binary searches.
lokisapocalypse
Messages
32
Reaction score
0
I am working on some homework about binary searches. In case you don't know, a binary search of x items takes at most log base 2 (x) searches to find what you are looking for (assuming it is sorted data of course). Now we are asked if using a phone book as an example, we have a reference to the first name on each page, how does that change the at most number of searches.

In other words, if I have x names in the phone book with y names on z pages (x = y*z). How much is that different than log base 2 (x). Using this method it takes at most log base 2 (y) searches to find the page and then log base 2 (z) searches to find the name on that page ( log base 2 (y) + log base 2 (z) ). It seems to be the case that log base 2 (x) = log base 2 (y) + log base 2 (z). Can anyone prove this for me? Thanks.
 
Physics news on Phys.org
It's not clear what you want to prove. If you sinply want to prove that, given x = yz, then log(x) = log(y) + log(z) simply recall the product rule for logarithms : log(yz) = log(y) + log(z).
...but I suspect you are asking for something else.

I'm not sure, so I'll allow you to clarify.
 
Last edited:
OR that 2^(x)*2^(y)=2^(x+y)
 
Actually that was all I was asking for, thanks!
 
Thread 'Correct statement about size of wire to produce larger extension'
The answer is (B) but I don't really understand why. Based on formula of Young Modulus: $$x=\frac{FL}{AE}$$ The second wire made of the same material so it means they have same Young Modulus. Larger extension means larger value of ##x## so to get larger value of ##x## we can increase ##F## and ##L## and decrease ##A## I am not sure whether there is change in ##F## for first and second wire so I will just assume ##F## does not change. It leaves (B) and (C) as possible options so why is (C)...

Similar threads

  • · Replies 2 ·
Replies
2
Views
901
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
855
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 10 ·
Replies
10
Views
3K
Replies
0
Views
1K
  • · Replies 2 ·
Replies
2
Views
14K
  • · Replies 6 ·
Replies
6
Views
2K