Lembaga : UIN Maulana Malik Ibrahim Malang
Jurusan : Teknik Informatika

A. Pertidaksamaan Satu Variable

LEMBAR KERJA MAHASISWA

Selesaikan Pertidaksamaan berikut :

1) 4x – 7 < 3x – 5
2) 2x – 4 ≤ 6 – 7x ≤ 3x + 6
3) x2 + x – 12 < 0
4) 3x2 - 11 -4 ≤ 0
5) x + 5/2x-1 ≤ 0

Jawab :

Soal 1

* Penyelesaian Manual : 
4x – 7 < 3x – 5
4x - 3x < 7 - 5
x < 2
  • Untuk penyelesaian pertidaksamaan pada R kita menggunakan bantuan dari table dengan menggunakan fungsi root dan grafik menggunakan fungsi bar plot(). Pertama- tama kita akan membuat table terlebih dahulu. Masukkan codingan berikut.
root_table <- function(f, a, b, N=20){
    h <- abs((a+b)/N)
    x <- seq(from=a, to=b, by=h)
    fx <- rep(0, N+1)
    for(i in 1:(N+1)){
      fx[i] <- f(x[i])
    }
    data <- data.frame(x=x, fx=fx)
    return(data)
}
  • kemudian masukkan kode berikut untuk menampilkan table,
# List code untuk menampilkan table

tabel <- root_table(f=function(x){ x<2},
                     a=0, b=1.9, N=10)
print(tabel)
##       x fx
## 1  0.00  1
## 2  0.19  1
## 3  0.38  1
## 4  0.57  1
## 5  0.76  1
## 6  0.95  1
## 7  1.14  1
## 8  1.33  1
## 9  1.52  1
## 10 1.71  1
## 11 1.90  1
  • Gunakan List kode ini untuk memunculkan jendela grafik,
# membuat vektor data 
x <- c(0:1.9); y <- x<2

# membagi jendela grafik menajdi 1 baris dan 1 kolom
par(mfrow=c(1,1))

# Output
plot(x, y, type="o")

Soal 2

# Penyelesaian Manual : 
2x – 4 ≤ 6 – 7x ≤ 3x + 6   

# Ruas Kiri     
2x – 4 ≤ 6 – 7x   
2x + 7x ≤ 6 + 4
9x ≤ 10
x ≤ 10/9

# Ruas Kanan
6 – 7x ≤ 3x + 6     
6 - 6 ≤ 3x + 7x
0 ≤ 10x
x ≥ 0

# Himpunan Penyelesaian
HP : {0 ≤ x ≤ 10/9}
  • Menampilkan Table
root_table <- function(f, a, b, N=20){
    h <- abs((a+b)/N)
    x <- seq(from=a, to=b, by=h)
    fx <- rep(0, N+1)
    for(i in 1:(N+1)){
      fx[i] <- f(x[i])
    }
    data <- data.frame(x=x, fx=fx)
    return(data)
}
# List code untuk menampilkan table

tabel <- root_table(f=function(x){ x <= 10/9},
                     a=0, b=1., N=20)
print(tabel)
##       x fx
## 1  0.00  1
## 2  0.05  1
## 3  0.10  1
## 4  0.15  1
## 5  0.20  1
## 6  0.25  1
## 7  0.30  1
## 8  0.35  1
## 9  0.40  1
## 10 0.45  1
## 11 0.50  1
## 12 0.55  1
## 13 0.60  1
## 14 0.65  1
## 15 0.70  1
## 16 0.75  1
## 17 0.80  1
## 18 0.85  1
## 19 0.90  1
## 20 0.95  1
## 21 1.00  1
  • Menampilkan Grafik
# membuat vektor data 
x <- c(0:1.11); y <- x*0

# membagi jendela grafik menajdi 1 baris dan 1 kolom
par(mfrow=c(1,1))

# Output
plot(x, y, type="o")

Soal 3

# Penyelesaian Manual : 
x^2 + x – 12 < 0   

# Difaktorkan
(x + 4)(x - 3)
x = -4 v x = 3

# Himpunan Penyelesaian
HP :{-4 < x < 3}
  • Menampilkan Table
root_table <- function(f, a, b, N=20){
    h <- abs((a+b)/N)
    x <- seq(from=a, to=b, by=h)
    fx <- rep(0, N+1)
    for(i in 1:(N+1)){
      fx[i] <- f(x[i])
    }
    data <- data.frame(x=x, fx=fx)
    return(data)
}
# List code untuk menampilkan table

tabel <- root_table(f=function(x){ x^2+x-12},
                     a=0, b=2.9 ,N=10)
print(tabel)
##       x       fx
## 1  0.00 -12.0000
## 2  0.29 -11.6259
## 3  0.58 -11.0836
## 4  0.87 -10.3731
## 5  1.16  -9.4944
## 6  1.45  -8.4475
## 7  1.74  -7.2324
## 8  2.03  -5.8491
## 9  2.32  -4.2976
## 10 2.61  -2.5779
## 11 2.90  -0.6900
  • Menampilkan Grafik
# membuat vektor data 
x <- c(-4:3); y <- x^2+x-12

# membagi jendela grafik menajdi 1 baris dan 1 kolom
par(mfrow=c(1,1))

# Output
plot(x, y, type="o")

Soal 4

# Penyelesaian Manual : 
3x^2 - 11x -4     
    
# Difaktorkan
(x - 4)(3x + 1)
x = 4 v x = -1/3

# Himpunan Penyelesaian
HP :{-1/3 ≤ x ≤ 4}
  • Menampilkan Table
root_table <- function(f, a, b, N=20){
    h <- abs((a+b)/N)
    x <- seq(from=a, to=b, by=h)
    fx <- rep(0, N+1)
    for(i in 1:(N+1)){
      fx[i] <- f(x[i])
    }
    data <- data.frame(x=x, fx=fx)
    return(data)
}
# List code untuk menampilkan table

tabel <- root_table(f=function(x){ 3*x^2 - 11*x -4 },
                     a=0, b=4 ,N=10)
print(tabel)
##      x     fx
## 1  0.0  -4.00
## 2  0.4  -7.92
## 3  0.8 -10.88
## 4  1.2 -12.88
## 5  1.6 -13.92
## 6  2.0 -14.00
## 7  2.4 -13.12
## 8  2.8 -11.28
## 9  3.2  -8.48
## 10 3.6  -4.72
## 11 4.0   0.00
  • Menampilkan Grafik
# membuat vektor data 
x <- c(-0.3:4); y <- 3*x^2 - 11*x -4

# membagi jendela grafik menajdi 1 baris dan 1 kolom
par(mfrow=c(1,1))

# Output
plot(x, y, type="o")

Soal 5

# Penyelesaian Manual : 
x + 5/2x-1 ≤ 0   
    
# Pembilang
x + 5 = 0
x = -5

# Penyebut
2x - 1 != 0
x != 1/2

# Himpunan Penyelesaian
HP :{x/-5<x<1/2, x ∈ R}
  • Menampilkan Table
root_table <- function(f, a, b, N=20){
    h <- abs((a+b)/N)
    x <- seq(from=a, to=b, by=h)
    fx <- rep(0, N+1)
    for(i in 1:(N+1)){
      fx[i] <- f(x[i])
    }
    data <- data.frame(x=x, fx=fx)
    return(data)
}
# List code untuk menampilkan table

tabel <- root_table(f=function(x){ x+5/2*x-1 },
                     a=-5, b=0 ,N=20)
print(tabel)
##        x      fx
## 1  -5.00 -18.500
## 2  -4.75 -17.625
## 3  -4.50 -16.750
## 4  -4.25 -15.875
## 5  -4.00 -15.000
## 6  -3.75 -14.125
## 7  -3.50 -13.250
## 8  -3.25 -12.375
## 9  -3.00 -11.500
## 10 -2.75 -10.625
## 11 -2.50  -9.750
## 12 -2.25  -8.875
## 13 -2.00  -8.000
## 14 -1.75  -7.125
## 15 -1.50  -6.250
## 16 -1.25  -5.375
## 17 -1.00  -4.500
## 18 -0.75  -3.625
## 19 -0.50  -2.750
## 20 -0.25  -1.875
## 21  0.00  -1.000
  • Menampilkan Grafik
# membuat vektor data 
x <- c(-5:0.5); y <- x+5/2*x-1

# membagi jendela grafik menajdi 1 baris dan 1 kolom
par(mfrow=c(1,1))

# Output
plot(x, y, type="o")

Daftar Pustaka