#include <iostream>
#include <iomanip>
#include <vector>
#include <queue>

using namespace std;
using ld = long double;

struct Graph {
    Graph(const int n)
    {
        edge.resize(n);
    }
    void addEdge(const int from, const int to)
    {
        edge[from].push_back(to);
    }
    vector<vector<int>> edge;
};


int main()
{
    while (true) {
        int N;
        cin >> N;
        if (N == 0) {
            break;
        }
        Graph g(N);
        vector<ld> p(N, 0);
        for (int i = 0; i < N; i++) {
            cin >> p[i];
            int M;
            cin >> M;
            for (int j = 0; j < M; j++) {
                int from;
                cin >> from;
                from--;
                g.addEdge(i, from);
            }
        }

        vector<vector<bool>> reachable(N, vector<bool>(N, false));
        for (int i = 0; i < N; i++) {
            queue<int> q;
            vector<bool> used(N, false);
            q.push(i);
            used[i] = true;
            reachable[i][i] = true;
            while (not q.empty()) {
                const int s = q.front();
                q.pop();
                for (int to : g.edge[s]) {
                    reachable[i][to] = true;
                    if (used[to]) {
                        continue;
                    }
                    used[to] = true;
                    q.push(to);
                }
            }
        }

        vector<int> number(N);
        for (int i = 0; i < N; i++) {
            number[i] = i;
        }
        for (int i = 0; i < N; i++) {
            for (int j = i + 1; j < N; j++) {
                if (reachable[i][j] and reachable[j][i]) {
                    number[j] = number[i];
                }
            }
        }
        vector<ld> prob(N, -1);
        for (int i = 0; i < N; i++) {
            prob[number[i]] = (prob[number[i]] == -1) ? p[i] : prob[number[i]] * p[i];
        }

        vector<int> indim(N, 0);
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < N; j++) {
                if (i == j) {
                    continue;
                }
                if (reachable[i][j] and number[i] != number[j]) {
                    indim[number[j]]++;
                }
            }
        }
        ld ans = 1;
        for (int i = 0; i < N; i++) {
            if (indim[i] == 0 and prob[i] != -1) {
                ans *= (1 - prob[i]);
            }
        }
        cout << fixed << setprecision(10) << ans << endl;
    }


    return 0;
}