# N<=4なのですべての組合せを計算しても間に合うか # AだけpermutationsすればBはpermutations必要ないだろう from itertools import permutations N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) A_all = [] for combo in permutations(range(N), N): temp = [] for c in combo: temp.append(A[c]) A_all.append(temp) #print(A_all) win = 0 lose = 0 draw = 0 for a in A_all: win_t = 0 lose_t = 0 draw_t = 0 for i in range(N): if a[i] > B[i]: win_t += 1 elif a[i] < B[i]: lose_t += 1 elif a[i] == B[i]: draw_t += 1 if win_t > lose_t: win += 1 elif win_t < lose_t: lose += 1 elif win_t == lose_t: draw += 1 ans = win/(win+lose+draw) print(ans)