from itertools import permutations N = int(input()) A = list(map(int,input().split())) B = list(map(int,input().split())) game = 0 win = 0 for nB in permutations(B,N): game += 1 cnt = 0 for a,b in zip(A,nB): if a > b: cnt += 1 if 2*cnt > N: win += 1 p = win / game print(p)