#include <bits/stdc++.h>
using namespace std;
class G {
public:
  vector<vector<int>> p, inv, sp, sinv;
  int n, m;
  vector<int> b, c, depth;
  vector<bool> a;
  G(int nn, vector<vector<int>> &np, vector<vector<int>> &ninv) {
    n = nn;
    p = np;
    inv = ninv;
    a.resize(n);
    c.resize(n);
    for (int i = 0; i < n; i++)
      c[i] = -1;
  }
  void dfs(int i) {
    if (a[i])
      return;
    a[i] = true;
    for (auto &j : p[i]) {
      if (a[j])
        continue;
      dfs(j);
    }
    b.push_back(i);
  }
  void dfs2(int i, int id) {
    if (c[i] > -1)
      return;
    c[i] = id;
    for (auto &j : inv[i]) {
      if (c[j] > -1)
        continue;
      dfs2(j, id);
    }
  }
  void solve() {
    for (int i = 0; i < n; i++)
      dfs(i);
    int j = 0;
    for (int i = n - 1; i >= 0; i--) {
      if (c[b[i]] > -1)
        continue;
      dfs2(b[i], j++);
    }
    m = j;
    sp.resize(m);
    sinv.resize(m);
    vector<set<int>> sps(m);
    for (int i = 0; i < n; i++) {
      for (int &j : p[i]) {
        if (c[i] == c[j])
          continue;
        sps[c[i]].insert(c[j]);
      }
    }
    for (int i = 0; i < m; i++) {
      for (auto &j : sps[i]) {
        sp[i].push_back(j);
        sinv[j].push_back(i);
      }
    }
  }
};

int main() {
  while (true) {
    int n;
    cin >> n;
    if (n == 0)
      break;
    vector<vector<int>> p(n), inv(n);
    vector<double> z(n);
    for (int i = 0; i < n; i++) {
      cin >> z[i];
      int m;
      cin >> m;
      for (int j = 0; j < m; j++) {
        int k;
        cin >> k;
        k--;
        p[i].push_back(k);
        inv[k].push_back(i);
      }
    }
    G g(n, p, inv);
    g.solve();

    int m = g.m;
    vector<double> z2(m);
    for (int i = 0; i < m; i++) {
      z2[i] = 1.;
    }
    for (int i = 0; i < n; i++) {
      z2[g.c[i]] *= z[i];
    }
    double ans = 1.;
    for (int i = 0; i < m; i++) {
      if (g.sinv[i].size() == 0) {
        ans *= (1. - z2[i]);
      }
    }
    printf("%.9lf\n", ans);
  }
  return 0;
}
