universitas: Universitas Islam Negri Maulana Malik Ibrahim Malang

Jurusan: Teknik Informatika

soal-soal dan penyelesaiannya menggunakan fungsi plot() pada RSTUDIO

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

soal 1

**2x – 4 ≤ 6 – 7x ≤ 3*x + 6**

penyelesaian soal:

Jadikan menjadi dua pertidaksamaan :

Pertidaksamaan pertama :

6 - 7x > 2x - 4

-9x > -10

x < 10 / 9

Pertidaksamaan kedua :

6 - 7x ≤ 3x + 6

-7x + 3x ≤ 6 - 6

-10x ≤ 0

x ≥ 0

HP = { 0 ≤ x < 10 / 9 }

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)
}
tabel <- root_table(f=function(x){4*x-7-3*x+5},
                     a=0, b=1, N=10)
print(tabel)
##      x   fx
## 1  0.0 -2.0
## 2  0.1 -1.9
## 3  0.2 -1.8
## 4  0.3 -1.7
## 5  0.4 -1.6
## 6  0.5 -1.5
## 7  0.6 -1.4
## 8  0.7 -1.3
## 9  0.8 -1.2
## 10 0.9 -1.1
## 11 1.0 -1.0
# membuat vektor data 
x <- c(-0:10); y <- 4*x-7-3*x+5
# membagi jendela grafik menajdi 1 baris dan 1 kolom
par(mfrow=c(1,1))

# output
  plot(x, y, type="l")

soal 2

**2x – 4 ≤ 6 – 7x ≤ 3*x + 6**

penyelesaian soal:

adikan menjadi dua pertidaksamaan :

Pertidaksamaan pertama :

6 - 7x > 2x - 4

-9x > -10

x < 10 / 9

Pertidaksamaan kedua :

6 - 7x ≤ 3x + 6

-7x + 3x ≤ 6 - 6

-10x ≤ 0

x ≥ 0

HP = { 0 ≤ x < 10 / 9 }

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)
}
tabel <- root_table(f=function(x){ 2*x - 4 - 6 + 7*x + 3*x + 6},
                     a=0, b=1, N=10)
print(tabel)
##      x   fx
## 1  0.0 -4.0
## 2  0.1 -2.8
## 3  0.2 -1.6
## 4  0.3 -0.4
## 5  0.4  0.8
## 6  0.5  2.0
## 7  0.6  3.2
## 8  0.7  4.4
## 9  0.8  5.6
## 10 0.9  6.8
## 11 1.0  8.0
# membuat vektor data 
x <- c(-0:10); y <-  2*x - 4 - 6 + 7*x + 3*x + 6
# membagi jendela grafik menajdi 1 baris dan 1 kolom
par(mfrow=c(1,1))

# output
  plot(x, y, type="l")

SOAL 3

**x2 + 1x -12 < 0

penyelesaian soal:

Jadikan menjadi dua pertidaksamaan :

Pertidaksamaan pertama :

x2 + x – 12 < 0

( x + 4 ) ( x -3 ) < 0

x + 4 > 0

x > -4

x - 3 < 0

x < 3

HP = { -4 < x < 3 }

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)
}
tabel <- root_table(f=function(x){ x^2 + x - 12},
                     a=0, b=2, N=10)
print(tabel)
##      x     fx
## 1  0.0 -12.00
## 2  0.2 -11.76
## 3  0.4 -11.44
## 4  0.6 -11.04
## 5  0.8 -10.56
## 6  1.0 -10.00
## 7  1.2  -9.36
## 8  1.4  -8.64
## 9  1.6  -7.84
## 10 1.8  -6.96
## 11 2.0  -6.00
# 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="l")

SOAL 4

** 3x^2 - 11x - 4 <= 0 **

penyelesaian soal:

himpunanan penyelesaian persamaan 3x2 - 11x -4 < 0 (3x + 1)(x-4)<=0 x < 4 atau x > -1/3

Hp=-1/3 < x < 4 HP=-0.33 < x < 4

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)
}
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
# membuat vektor data 
x <- c(-0.33: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="l")

SOAL 5

( x + 5 ) / ( 2x - 1 ) ≤ 0

penyelesaian soal:

Pertidaksamaan pertama :

( x + 5 ) / ( 2x - 1 ) ≤ 0

2x - 1 < 0

2x < 1

x < 1 / 2

Pertidaksamaan kedua

x + 5 ≥ 0

x ≥ -5

HP = { -5 ≤ x < 1/2 }

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)
}
tabel <- root_table(f=function(x){x+5/2*x-1},
                     a=-5, b=0, N=10)

print(tabel)
##       x     fx
## 1  -5.0 -18.50
## 2  -4.5 -16.75
## 3  -4.0 -15.00
## 4  -3.5 -13.25
## 5  -3.0 -11.50
## 6  -2.5  -9.75
## 7  -2.0  -8.00
## 8  -1.5  -6.25
## 9  -1.0  -4.50
## 10 -0.5  -2.75
## 11  0.0  -1.00
 # membuat vektor data 
    x <- c(-5:1.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="l")

REFERENSI

Suhartono.2015.Memahami Kalkulus Dasar Menggunakan Wolfram Mathematica 9.UIN Maliki Malang: Malang.

https://bookdown.org/moh_rosidi2610/Metode_Numerik/dataviz.html#plotfunc

https://www.google.com/searchq=x+%2B+5%2F2x+%E2%88%92+1+%E2%89%A4+0&oq=x+%2B+5%2F2x+%E2%88%92+1+%E2%89%A4+0&aqs=chrome..69i57j0i22i30l7j0i10i22i30l2.1120j0j4&sourceid=chrome&ie=UTF-8

https://matematikaakuntansi.blogspot.com/2016/11/contoh-grafik-himpunan-penyelesaian-sistem-pertidaksamaan-linier-satu-variabel.html