import itertools N = int(input()) lsA = list(map(int,input().split())) lsB = list(map(int,input().split())) lspa = itertools.permutations(lsA,N) lspb = itertools.permutations(lsB,N) cntall = 0 cntwin = 0 for A in lspa: for B in lspb: point = 0 for i in range(N): if A[i] > B[i]: point += 1 if point > N//2: cntwin += 1 cntall += 1 print(cntwin/cntall)