from itertools import permutations N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) perm = permutations(A, N) ans = [0, 0] for a in perm: cnt = [0, 0] for i in range(N): if a[i] > B[i]: cnt[0] += 1 else: cnt[1] += 1 if cnt[0] > cnt[1]: ans[0] += 1 else: ans[1] += 1 print(ans[0] / sum(ans))