from itertools import permutations

N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))

X=permutations(range(N))
Y=permutations(range(N))

win=0
other=0

for x in X:
    for y in Y:
        a=0
        b=0
        for i in range(N):
            if A[x[i]]>B[y[i]]:
                a+=1
            elif A[x[i]]<B[y[i]]:
                b+=1

        if a>b:
            win+=1
        else:
            other+=1

print(win/(win+other))