> ## Documentation Index
> Fetch the complete documentation index at: https://v1-learn.neoartd.my.id/llms.txt
> Use this file to discover all available pages before exploring further.

# Relasi

## Representasi Relasi

### Using Matrix

A relation between finite sets cam be represented using a zero-one matrix. Suppose that $R$ is a relation from $A = {a_1, a_2, \dots, a_m} \text{ to } B = {b_1, b_2, \dots, b_n}$.
(Here the elements of sets $A$ and $B$ have been listed in a particular, but arbitary, order. Furthermore, when $A = B$ we use the same ordering for $A$ and $B$.)
The relation $R$ can be represented by the matrix $M_R = [m_{ij}]$, where

> Sebuah relasi antara himpunan yang terbatas dapat direpresentasikan menggunakan matriks nol-satu. Misalkan $R$ adalah relasi dari $A = {a_1, a_2, \dots, a_m} \text{ ke } B = {b_1, b_2, \dots, b_n}$. (Di sini elemen-elemen himpunan $A$ dan $B$ telah dicantumkan dalam urutan tertentu, tetapi sembarangan. Selanjutnya, ketika $A = B$ kita menggunakan urutan yang sama untuk $A$ dan $B$.) Relasi $R$ dapat direpresentasikan oleh matriks $M_R = [m_{ij}]$, dimana

<Tip>
  $m_{ij} = \begin{cases} 1 & \text{if } (a_i, b_j) \in R \\ 0 & \text{if } (a_i, b_j) \notin R \end{cases}$
</Tip>

In other words, the zero-one matrix representing $R$ has a 1 as its $(i, j)$ entry when $(a_i) is related to $b\_j$, and a 0 in this position if $(a\_i)$is not related to$b\_j\$. (Such a representation depends on the ordering used for A and B.)
