from math import factorial import sys sys.setrecursionlimit(100000) used1 = [] used2 = [] n = 0 ap = [] bp = [] a, b = ([], []) def rec2(pos): ans = 0 if pos == n: # a, b の勝ち数 aa, bb = (0, 0) for x, y in zip(ap, bp): if a[x] > b[y]: aa += 1 elif a[x] < b[y]: bb += 1 return 1 if aa > bb else 0 for i in range(n): if not used2[i]: bp.append(i) used2[i] = True ans += rec2(pos+1) used2[i] = False bp.pop() return ans def rec1(pos): ans = 0 if pos == n: # return rec2(0, a, b) return rec2(0) for i in range(n): if not used1[i]: used1[i] = True ap.append(i) ans += rec1(pos+1) ap.pop() used1[i] = False return ans def main(): global used1, used2, n, a, b n = int(input()) used1 = [False for i in range(n)] used2 = [False for i in range(n)] a = [int(i) for i in input().split()] b = [int(i) for i in input().split()] print(rec1(0)/factorial(n)**2) if __name__ == '__main__': main()