from itertools import permutations N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) def factorial(n): if n == 0: return 1 else: return n*factorial(n-1) Awin = 0 for a in permutations(range(N),N): for b in permutations(range(N),N): akachi = 0 bkachi = 0 for i in range(N): if A[a[i]] > B[b[i]]: akachi += 1 elif A[a[i]] < B[b[i]]: bkachi += 1 if akachi > bkachi: Awin += 1 print(Awin/(factorial(N)**2))