def resolve(): import sys import itertools import math readline = sys.stdin.readline N = int(readline().strip()) A = [int(x) for x in readline().split()] B = [int(x) for x in readline().split()] ans = 0 for i in itertools.permutations(A): for j in itertools.permutations(B): win, lose = 0, 0 for k in range(N): if i[k] > j[k]: win += 1 else: lose += 1 if win > lose: ans += 1 print(ans / math.factorial(N) ** 2) resolve()