import itertools, math n = int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) de = math.factorial(n) nu = 0 for perm in itertools.permutations(range(n)): count = 0 for i in range(n): if a[i] > b[perm[i]]: count += 1 elif a[i] < b[perm[i]]: count -= 1 if count > 0: nu += 1 print(nu / de)