ini adalah script untuk meng-generate data nilai acak untuk pembuatan tabel distribusi frekuensi
- harus sudah menginstall nodejs
- download scriptnya
- buka terminal/cmd
- jalankan perintah
node test.js
(versi statis) ataunode rl.js
(versi dinamis, sesuai inputan user)
➜ node test.js
=============================================
1. Generate random data, nilai antara 52-100
[
79, 96, 71, 67, 60, 94, 62, 69, 86, 78, 59, 85,
61, 53, 60, 92, 75, 61, 61, 91, 87, 98, 75, 76,
95, 77, 67, 97, 81, 88, 66, 91, 60, 88, 59, 68,
68, 77, 90, 74, 97, 76, 77, 76, 54, 76, 92, 95,
97, 57, 69, 73, 75, 76, 81, 62, 62, 87, 72, 86,
59, 80, 63, 74, 91, 83, 80, 75, 96, 62, 84, 71,
79, 87, 78, 70, 62, 60, 61, 74, 53, 74, 76, 66,
53, 88, 63, 68, 77, 98, 91, 54, 67, 77, 92, 53,
63, 66, 69, 73
]
=============================================
2. Urutkan data dari nilai terkecil
[
53, 53, 53, 53, 54, 54, 57, 59, 59, 59, 60, 60,
60, 60, 61, 61, 61, 61, 62, 62, 62, 62, 62, 63,
63, 63, 66, 66, 66, 67, 67, 67, 68, 68, 68, 69,
69, 69, 70, 71, 71, 72, 73, 73, 74, 74, 74, 74,
75, 75, 75, 75, 76, 76, 76, 76, 76, 76, 77, 77,
77, 77, 77, 78, 78, 79, 79, 80, 80, 81, 81, 83,
84, 85, 86, 86, 87, 87, 87, 88, 88, 88, 90, 91,
91, 91, 91, 92, 92, 92, 94, 95, 95, 96, 96, 97,
97, 97, 98, 98
]
=============================================
3. Jangkauan (R)
R = Max - Min
R = 98 - 53
R = 45
=============================================
4. Banyaknya Kelas (k)
k = 1 + 3.3 log n
k = 1 + 3.3 log 100
k = 8
=============================================
5. Panjang interval kelas (i)
i = R/k
i = 6
=============================================
6. Batas bawah kelas pertama
53
=============================================
7. Tabel frekuensi
No.| Nilai | Frekuensi
1. | 53-58 | 7
2. | 59-64 | 19
3. | 65-70 | 13
4. | 71-76 | 19
5. | 77-82 | 13
6. | 83-88 | 11
7. | 89-94 | 9
8. | 95-100 | 9
➜ node rl.js
Masukkan jumlah n: 40
Masukkan perkiraan nilai nMin: 56
Masukkan perkiraan nilai nMax: 99
=============================================
1. Generate random data, nilai antara 56-99
[
94, 84, 98, 58, 97, 78, 93, 66, 72, 83,
89, 72, 61, 64, 93, 76, 82, 62, 74, 93,
81, 87, 69, 60, 60, 62, 94, 84, 86, 76,
89, 84, 96, 90, 77, 83, 87, 96, 84, 91
]
=============================================
2. Urutkan data dari nilai terkecil
[
58, 60, 60, 61, 62, 62, 64, 66, 69, 72,
72, 74, 76, 76, 77, 78, 81, 82, 83, 83,
84, 84, 84, 84, 86, 87, 87, 89, 89, 90,
91, 93, 93, 93, 94, 94, 96, 96, 97, 98
]
=============================================
3. Jangkauan (R)
R = Max - Min
R = 98 - 58
R = 40
=============================================
4. Banyaknya Kelas (k)
k = 1 + 3.3 log n
k = 1 + 3.3 log 40
k = 7.6
⌊k1⌋ = 7
⌈k2⌉ = 8
=============================================
5. Panjang interval kelas (i)
i = R/k
i1 = R/k1 = 40/7 = 5.714285714285714
⌊i1a⌋ = 5
⌈i1b⌉ = 6
i2 = R/k2 = 40/8 = 5
⌊i2a⌋ = 5
⌈i2b⌉ = 5
=============================================
6. Batas bawah kelas pertama
58
=============================================
7. Tabel frekuensi
---------------------------------------------
k7 i5
---------------------------------------------
No.| Nilai | Frekuensi
1. | 58-62 | 6
2. | 63-67 | 2
3. | 68-72 | 3
4. | 73-77 | 4
5. | 78-82 | 3
6. | 83-87 | 9
7. | 88-92 | 4
---------------------------------------------
---------------------------------------------
k7 i6
---------------------------------------------
No.| Nilai | Frekuensi
1. | 58-63 | 6
2. | 64-69 | 3
3. | 70-75 | 3
4. | 76-81 | 5
5. | 82-87 | 10
6. | 88-93 | 7
7. | 94-99 | 6
---------------------------------------------
---------------------------------------------
k8 i5
---------------------------------------------
No.| Nilai | Frekuensi
1. | 58-62 | 6
2. | 63-67 | 2
3. | 68-72 | 3
4. | 73-77 | 4
5. | 78-82 | 3
6. | 83-87 | 9
7. | 88-92 | 4
8. | 93-97 | 8
---------------------------------------------
---------------------------------------------
k8 i5
---------------------------------------------
No.| Nilai | Frekuensi
1. | 58-62 | 6
2. | 63-67 | 2
3. | 68-72 | 3
4. | 73-77 | 4
5. | 78-82 | 3
6. | 83-87 | 9
7. | 88-92 | 4
8. | 93-97 | 8
---------------------------------------------
Selesai!
Jika ada kesalahan, ya maap!! ini saya buat karena saya juga masih belajar