Hi, this time we'll learn How to List All Possible Combination (Consisting 2 Elements) of Two Sets in Prolog.
Lets begin...
For example there are 2 sets, they are M {a,b} and N {p,q}.
Then we will combine M and N.
We know that the result of combination of 2 sets is m*n combinations, with m is elements of M and n is elements of N.
So, combination of set M and N will have 2*2=4 combinations.
First, run prolog.exe then make a database.
So,there are 4 possible elements of combinations there are : { (a,p), (a,q), (b,p), (b,q) }.
Okey...this is our first tutorial, hope you enjoy our process of learning.
We'll apreciate if you willing to give us your comment.
See you next time.
Regards,
Mathlovers.
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar