from itertools import permutations N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) al, wi = 0, 0 for v1 in permutations(range(N), N): for v2 in permutations(range(N), N): ss = 0 al += 1 for i in range(N): if A[v1[i]]>B[v2[i]]: ss += 1 if ss>N-ss: wi+=1 print(wi/al)