program main
  implicit none
  integer i, N, K, omote
  real(8)  rate, rate_elm, K2, N2, i2

  read(*, *)N, K
  K2 = real(K)
  rate_elm = 0.5d0**log2(K2)
  omote = int(rate_elm)
  rate = 0.0d0
  do i = 1,N
    i2 = real(i)
    if (omote == 0) then
      rate = rate + 1.0d0
    else if (i2*(2**(omote-1.0d0)) > K2) then
      omote = omote-1.0d0
      rate = rate + 0.5d0**omote
    else
      !omote = omote-1
      rate = rate + 0.5d0**omote
    end if
  end do
  N2 = real(N)
  rate = rate/N2

  write(*,*) rate

contains


  real(8) function log2(x)
    implicit none
    real(8) x
    log2 = (log(x)/log(2.0d0)) + 1.0d0
    return
  end function log2

  
end program main
