from itertools import * N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) ans = 0 for a in permutations(A): for b in permutations(B): cnt = 0 for i in range(N): if a[i] > b[i]: cnt += 1 if cnt * 2 > N: ans += 1 for i in range(1, N + 1): ans /= i * i print(ans)