We have A ∪ B = {2, 5, 6, 8} ∪ {5, 7, 9, 1}
= {, , , , , , , }
= {, , , , , , }.
Note that the common element 5 was taken only once while writing A ∪ B.