#include <bits/stdc++.h>

using namespace std;

struct UnionFind
{
  vector< int > data;

  UnionFind(int sz)
  {
    data.assign(sz, -1);
  }

  int find(int k)
  {
    if(data[k] < 0) return (k);
    return (data[k] = find(data[k]));
  }

  void unite(int x, int y)
  {
    x = find(x);
    y = find(y);
    if(x == y) return;
    if(data[x] > data[y]) swap(x, y);
    data[x] += data[y];
    data[y] = x;
  }
};

void dfs(int idx, bool *used, vector< int > &order, vector< int > *g)
{
  if(used[idx]++) return;
  for(auto &to : g[idx]) dfs(to, used, order, g);
  order.push_back(idx);
};

void rdfs(int idx, int k, int *cmp, vector< int > *rg)
{
  if(~cmp[idx]) return;
  cmp[idx] = k;
  for(auto &to : rg[idx]) rdfs(to, k, cmp, rg);
};

int main()
{
  int N;
  double p[100];
  int cmp[100];
  bool used[100];
  bool in[100];

  while(scanf("%d", &N), N) {
    vector< int > g[100], rg[100];

    for(int i = 0; i < N; i++) {
      int M;
      scanf("%lf %d", &p[i], &M);
      while(M--) {
        int a;
        scanf("%d", &a);
        g[i].push_back(--a);
        rg[a].push_back(i);
      }
    }

    vector< int > order;
    memset(cmp, -1, sizeof(cmp));
    memset(used, false, sizeof(used));
    memset(in, 0, sizeof(in));
    for(int i = 0; i < N; i++) dfs(i, used, order, g);
    reverse(begin(order), end(order));
    for(int i : order) rdfs(i, i, cmp, rg);

    for(int i = 0; i < N; i++) {
      for(int &to : g[i]) in[cmp[to]] += cmp[i] != cmp[to];
    }
    double ret = 1.0;
    for(int i = 0; i < N; i++) {
      if(cmp[i] == i && !in[cmp[i]]) {
        double curr = 1.0;
        for(int j = 0; j < N; j++) {
          if(cmp[i] == cmp[j]) curr *= p[j];
        }
        ret *= 1 - curr;
      }
    }
    printf("%.10lf\n", ret);
  }
}