import itertools def fact(n): if n <= 1: return 1 return n * fact(n-1) n = int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) ans = 0 for i in itertools.permutations(a): for j in itertools.permutations(b): wa, wb = 0, 0 for k in range(n): if i[k] > j[k]: wa += 1 else: wb += 1 if wa > wb: ans += 1 print(ans / fact(n) ** 2)