import math from itertools import permutations from functools import reduce length = int(input()) A = [int(n) for n in input().split(" ")] B = [int(n) for n in input().split(" ")] answer = 0 total = 0 for_win = int(math.ceil(length / 2)) for a_comb in permutations(A, length): for b_comb in permutations(B, length): temp_win = 0 total += 1 # print(a_comb, b_comb, for_win, total, answer) for i in range(length): if a_comb[i] > b_comb[i]: temp_win += 1 if temp_win >= for_win: answer += 1 break print(answer / total)