#include <bits/stdc++.h>
#define int long long
#define uint unsigned int
#define pii pair<int, int>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FORR(i,a,b) for(int i=(a);i>=(b);--i)
#define REP(i,n) FOR(i,0,n)
#define REPR(i,n) FORR(i,n,0)
#define ALL(c) ((c).begin(),(c).end())
#define PB(a) push_back(a)
#define EMPB(...) emplace_back(__VA_ARGS__)
#define EMP(...) emplace(__VA_ARGS__)
#define MP(a,b) make_pair(a,b)
#define MT(...) make_tuple(__VA_ARGS__)
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define MINF(a) memset(a,0x3f,sizeof(a))
#define PW(n) (1LL<<(n))
using namespace std;
template <class T> inline bool CHMIN(T& a, T b) { if(a>b) { a=b; return 1; } return 0; }
template <class T> inline bool CHMAX(T& a, T b) { if(a<b) { a=b; return 1; } return 0; }
template <class T> inline void SORT(T& a) { sort(ALL(a)); }
template <class T> inline void REV(T& a) { reverse(ALL(a)); }
template <class T> inline void UNI(T& a) { SORT(a); a.erase(unique(ALL(a)),a.end()); }
template <class S, class T> ostream& operator<<(ostream& os, const pair<S,T> a) {
  return os << a.first << ' ' << a.second;
}
const int MOD = 1000000007;
const int INF = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-10;
/* ---------------------------------------------------------------------------------------------------- */

struct SCC {
  int n;
  vector<vector<int>> G, rG, nG, iG;
  vector<bool> used;
  vector<int> vs, cmp;
  SCC() {}
  SCC(int n) : n(n), G(n), rG(n), nG(n), iG(n), used(n), cmp(n) {}
  void add_edge(int from, int to) {
    G[from].push_back(to);
    rG[to].push_back(from);
  }
  void dfs(int v) {
    used[v] = true;
    for (auto u : G[v]) {
      if (!used[u]) dfs(u);
    }
    vs.push_back(v);
  }
  void rdfs(int v, int k) {
    used[v] = true;
    cmp[v] = k;
    for (auto u : rG[v]) {
      if (!used[u]) rdfs(u, k);
      else if (cmp[u] != cmp[v]) nG[cmp[u]].push_back(cmp[v]);
    }
  }
  int doit() {
    fill(used.begin(), used.end(), false);
    vs.clear();
    for (int i = 0; i < n; i++) {
      if (!used[i]) dfs(i);
    }
    fill(used.begin(), used.end(), false);
    int k = 0;
    for (int i = vs.size() - 1; i >= 0; i--) {
      if (!used[vs[i]]) rdfs(vs[i], k++);
    }
    nG.resize(k);
    for (int i = 0; i < k; i++) {
      nG[i].erase(unique(nG[i].begin(), nG[i].end()), nG[i].end());
    }
    for (int i = 0; i < n; i++) {
      iG[cmp[i]].push_back(i);
    }
    return k;
  }
};

int N;
double p[110];
int m[110];

signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);

  while (cin >> N, N) {
    SCC scc(N);
    REP(i,N) {
      cin >> p[i] >> m[i];
      REP(j,m[i]) {
        int a;
        cin >> a;
        scc.add_edge(i,a-1);
      }
    }
    int k = scc.doit();
    vector<vector<int>> g = scc.nG;
    vector<int> indeg(k,0);
    REP(i,k) {
      for (int j = 0; j < g[i].size(); j++) {
        indeg[g[i][j]]++;
      }
    }
    double ans = 1.0;
    REP(i,k) if (indeg[i] == 0) {
      vector<int> g2 = scc.iG[i];
      double sub = 1.0;
      for (int j = 0; j < g2.size(); j++) {
        sub *= p[g2[j]];
      }
      ans *= 1.0-sub;
    }
    cout << ans << endl;
  }

  return 0;
}


Measured memory_bytes: 3396