from itertools import permutations N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) ans = 0 s = 0 for p in permutations(A): win, lose = 0, 0 for i in range(N): if p[i]>B[i]: win += 1 else: lose += 1 if win>lose: ans += 1 s += 1 print("{:.10f}".format(ans/s))