#yukicoder No133 import itertools N = int(input()) A = list(map(int,input().split())) B = list(map(int,input().split())) Comb = list(itertools.permutations(B)) ans_all = len(Comb) ans_win = 0 for i in range(ans_all): B_ = list(Comb[i]) a_win = 0 b_win = 0 for j in range(len(B_)): if(A[j] > B_[j]): a_win += 1 elif(A[j] < B_[j]): b_win += 1 if(a_win > b_win): ans_win += 1 ans = ans_win/ans_all print(ans)