# https://yukicoder.me/problems/199 from itertools import * from math import factorial N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) cnt = 0 for b in permutations(B,N): res = [1 if A[i] > b[i] else 0 for i in range(N)] if sum(res) > N//2: cnt += 1 f = factorial(N) print(cnt/f)