#!/usr/bin/env python # -*- coding: utf-8 -*- from itertools import permutations n = int(input()) a = [int(i) for i in input().split()] b = [int(i) for i in input().split()] cnt = win = 0 for i in permutations(a, n): cnt += 1 w = 0 for x, y in zip(i, b): if x > y: w += 1 elif x < y: w -= 1 if w > 0: win += 1 print(win / cnt)