from itertools import permutations def calc(N,A,B): win = 0 al = list(permutations(range(N))) total = len(al) for v in al: a = 0 b = 0 for i in v: if A[i] > B[i]: a += 1 elif A[i] < B[i]: b += 1 if a > b: win += 1 return win/total def main(): N = int(input()) A = list(map(int,input().split(" "))) B = list(map(int,input().split(" "))) print(calc(N,A,B)) if __name__ == '__main__': main()