progs/pow.scala
changeset 572 4a1739f256fd
parent 564 b5d57d7064bb
child 577 7a437f1f689d
equal deleted inserted replaced
571:499007a7bce2 572:4a1739f256fd
     8 
     8 
     9 val A = Set("a", "b", "c", "d")
     9 val A = Set("a", "b", "c", "d")
    10 pow(A, 4).size                            // -> 256
    10 pow(A, 4).size                            // -> 256
    11 
    11 
    12 val B = Set("a", "b", "c", "")
    12 val B = Set("a", "b", "c", "")
       
    13 pow(B, 4)
    13 pow(B, 4).size                            // -> 121
    14 pow(B, 4).size                            // -> 121
    14 
    15 
    15 
    16 
    16 
    17 
    17 val B2 = Set("a", "b", "c", "")
    18 val B2 = Set("a", "b", "c", "")
    23 
    24 
    24 pow(C, 3)
    25 pow(C, 3)
    25 pow(C, 3).size                            // -> 15
    26 pow(C, 3).size                            // -> 15
    26 
    27 
    27 
    28 
    28 val A = Set("a", "b", "c", "d")
    29 //val A = Set("a", "b", "c", "d")
    29 pow(A, 4).size   
    30 //pow(A, 4).size   
    30 
    31 
    31 val A = Set("a", "b", "c")
    32 //val A = Set("a", "b", "c")
    32 pow(A, 5).size   
    33 //pow(A, 5).size   
    33 
    34 
    34 val A = Set("a", "b", "")
    35 //val A = Set("a", "b", "")
    35 pow(A, 5).size   
    36 //pow(A, 5).size   
    36 
    37 
    37 
    38 
    38 for (n <- (0 to 12).toList) 
    39 for (n <- (0 to 6).toList) 
    39   yield pow(A, n).size
    40   yield pow(B, n).size