from itertools import permutations import sys input = sys.stdin.readline def main(): N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) a_win, total = 0, 0 for a in permutations(A): for b in permutations(B): a_, b_ = 0, 0 for i in range(N): if a[i] > b[i]: a_ += 1 elif a[i] < b[i]: b_ += 1 if a_ > b_: a_win += 1 total += 1 print(a_win/total) if __name__ == "__main__": main()