Safe Cracking Combinatorics 
The lock of a safe consists of 3
  wheels, each of which may be set in 8 different ways positions. Due to a defect
  in the safe mechanism the door will open if any two of the three wheels are in
  the correct position. What is the smallest number of combinations which must
  be tried if one is to guarantee being able to open the safe (assuming the 'right
  combination' is not known)?

I understand that the above problem can be skillfully reduced to the following:
Given a set S of n elements, what is the minimum number of triplets in a family F of subsets of S of cardinality 3, such that any pair of elements of S is contained in at least one triplet of F. Assuming triplets also cover doublets. 
I'm not sure how to proceed after this, and I wonder if there's a shorter and more direct approach to the problem at hand. Could someone please help and explain the solution? 
Thanks! 
 A: I can't prove optimal, but I found a strategy that only requires 48 attempts.
Set the first two dials to position 1, then loop through the third dial. If it doesn't unlock then we know the first two dials are both wrong.
Set the first two dials to the next position and loop again through the third dial. Again, if it does not unlock then we know the first two dials are both wrong. 
Iterating the first two dials through the first four positions will take 32 attempts. After that, there are only 16 possibilities for the first two dials (4 x 4 numbers on each). Iterating them will take 16 attempts.
A: For each pair $(i,j)$ such that $0\leq i,j\leq 3$ the triples 
$$(i,j, i+j\mod 4)\;\;\;{\rm and}\;\;\;(4+i,4+j,4 +(i+j \mod 4))$$
will do the job, so $32$ is ''good number''. And it is a least number, I leave the prove to you. 
A: There are $8^3 = 512$ possible combinations; let us assume the combination is $abc$, the combinations $abz,ayc,xbc$ (where $ x \neq a,y \neq b, z \neq c$) will also work. If we start by trying $xyz$ then vary $y$ and $z$ over the $64$ possible pairs we will find the combination $xbc$. So we need to try $\color{blue}{64}$ possibilities.
