from itertools import permutations from math import factorial def main(): n = int(input()) A = list(map(int,input().split())) B = list(map(int,input().split())) ans = 0 for prdA in permutations(range(n)): for prdB in permutations(range(n)): a,b = 0,0 for i in range(n): if A[prdA[i]] > B[prdB[i]]: a += 1 elif A[prdA[i]] < B[prdB[i]]: b += 1 if a > b: ans += 1 print(ans/factorial(n)/factorial(n)) if __name__ == '__main__': main()