Join The Set: The Multiplication On The Set
This time we will discuss the multiplication on the set or the more frequently heard hipunan join. Multiple purpose here is not like multiplying 2 x 3 = 5, but we are combining two or more sets.
For example we have set A and B, A × B means the set of all ordered pairs with the first element of each pair selected from A and the second element selected from B.
Example:
A: {1,2,3} and B: {a, b, c},
then A x B = {(1, a), (1, b), (1, c), (2, a), (2, b), (2, c), (3, a), (3 , b), (3, c)}
After getting the process that occurs over and over - again we can make a program using nested loops. That loop is in the loop. I made it like this:
A: {1,2,3} and B: {a, b, c},
then A x B = {(1, a), (1, b), (1, c), (2, a), (2, b), (2, c), (3, a), (3 , b), (3, c)}
After getting the process that occurs over and over - again we can make a program using nested loops. That loop is in the loop. I made it like this:
Jadilah yang pertama mengomentari
Post a Comment