#include <bits/stdc++.h>
using namespace std;
#define int long long   // <-----!!!!!!!!!!!!!!!!!!!

#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
#define rrep2(i,a,b) for (int i=(a)-1;i>=b;i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define printV(v) for(auto x : v){cout << x << " ";} cout << endl
#define printVS(vs) for(auto x : vs){cout << x << endl;}
#define printVV(vv) for(auto v : vv){for(auto&& x : v){cout << x << " ";}cout << endl;}
#define printP(p) cout << p.first << " " << p.second << endl
#define printVP(vp) for(auto p : vp) printP(p);

typedef long long ll;
typedef pair<int, int> Pii;
typedef tuple<int, int, int> TUPLE;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<Pii> vp;
typedef vector<vector<int>> Graph;
const int inf = 1e9;
const int mod = 1e9 + 7;

class UnionFind {
private:
    int n;
    vector<int> uni;
public:
    UnionFind(int _n) {
        n = _n;
        uni.clear();
        uni.resize(n, -1);
    }
    int root(int x) {
        if (uni[x] < 0) return x;
        return uni[x] = root(uni[x]);
    }
    bool same(int x, int y) {
        return root(x) == root(y);
    }
    void unite(int x, int y) {
        x = root(x);
        y = root(y);
        if (x == y) return;
        if (uni[x] > uni[y]) swap(x, y);
        uni[x] += uni[y];
        uni[y] = x;
    }
    void print() {
        for (auto x : uni) cout << x << " ";
        cout << endl;
    }
};

bool reachable(const vvi &G, int s, int g) {
    int N = G.size();
    const int INF = 1e9;
    vi d(N, INF);
    queue<int> que;
    que.push(s);
    d[s] = 0;

    while (!que.empty()) {
        int pre = que.front(); que.pop();
        if (pre == g)
             break;

        for (auto nxt: G[pre]) {
            if (d[nxt] == INF) {
                que.push(nxt);
                d[nxt] = d[pre] + 1;
            }
        }
    }

    return d[g] < INF;
}

signed main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);

    int N;
    while (cin >> N, N) {
        vector<double> pr(N);
        vvi G(N);
        rep(i, N) {
            int m;
            cin >> pr[i] >> m;
            rep(j, m) {
                int x;
                cin >> x;
                x--;
                G[i].emplace_back(x);
            }
        }

        UnionFind uf(N);
        rep(j, N) {
            rep(i, j) {
                if (reachable(G, i, j) && reachable(G, j, i)) {
                    uf.unite(i, j);
                }
            }
        }

        map<int, bool> existIn;
        rep(i, N) existIn[uf.root(i)] = false;
        rep(from, N) {
            for (auto to : G[from]) {
                if (!uf.same(from, to)) existIn[uf.root(to)] = true;
            }
        }

        double ans = 1;
        for (auto p : existIn) {
            if (!p.second) {
                double temp = 1;
                rep(i, N) {
                    if (uf.root(i) == p.first) {
                        temp *= pr[i];
                    }
                }
                ans *= 1. - temp;
            }
        }

        printf("%.10f\n", ans);

    }
}

Measured memory_bytes: 3380