#include<cstdio>
#include<algorithm>
#include<vector>
#include<string.h>

using namespace std;

typedef long long ll;

int INF = 10000000;

int N;
double p[100];
int m[100], a[100][100];

class Tp{
public:
  int V;
  vector<int> G[100];
  vector<int> rG[100];
  vector<int> vs;
  bool used[100];
  int cmp[100];
  double rsum[100];
  void add(int from, int to) {
    G[from].push_back(to);
    rG[to].push_back(from);
  }
  void dfs(int v) {
    used[v] = true;
    for (int i = 0; i < G[v].size(); i++) {
      if(!used[G[v][i]]) dfs(G[v][i]);
    }
    vs.push_back(v);
  }
  void rdfs(int v, int k) {
    used[v] = true;
    cmp[v] = k;
    for (int i = 0; i < rG[v].size(); i++) {
      if (!used[rG[v][i]]) rdfs(rG[v][i], k);
    }
  }

  int scc() {
    memset(used, 0, sizeof(used));
    vs.clear();
    for (int v = 0; v < V; v++)
      if(!used[v]) dfs(v);
    memset(used, 0, sizeof(used));
    int k = 0;
    for (int i = vs.size() - 1; i >= 0; i--)
      if (!used[vs[i]]) rdfs(vs[i], k++);
    return k;
  }
  double ans() {
    int num = scc();
    for (int i = 0; i < num; i++) rsum[i] = 1.0;
    for (int i = 0; i < V; i++) rsum[cmp[i]] *= p[i];
    bool isTop[num];
    for (int i = 0; i < num; i++) isTop[i] = true;
    for (int i = 0; i < V; i++)
      for (int j = 0; j < m[i]; j++)
        if (cmp[i] != cmp[a[i][j]]) isTop[cmp[a[i][j]]] = false;
    double ans = 1.0;
    for (int i = 0; i < num; i++)
      if(isTop[i]) ans *= 1.0 - rsum[i];
    return ans;
  }
};

int main() {
  while (1) {
    scanf("%d", &N);
    if (N == 0) break;

    Tp t;
    t.V = N;

    for (int i = 0; i < N; i++) {
      scanf("%lf%d", &p[i], &m[i]);
      for (int j = 0; j < m[i]; j++) {
        scanf("%d", &a[i][j]);
        a[i][j]--;
        t.add(i, a[i][j]);
      }
    }
    printf("%f\n", t.ans());
  }
}
