Showing posts with label Review. Show all posts
Showing posts with label Review. Show all posts

Saturday, November 24, 2018

Pemodelan Untuk Komputasi : Selection Ii, Nested-If, Multiway-If, Dan Pola Soal ( Bahasa Inggris )

Pemodelan untuk Komputasi : Selection II, Nested-IF, Multi-IF, dan Contoh Soal ( Bahasa Inggris )






Introduction of Selection II



The Richter scale is a measurement of the strength of an earthquake. Every step in the scale, for example from 6.0 to 7.0, signifies a tenfold increase in the strength of the quake. We can categorize the scale into 5 categories: Category A (most structures fall), B (many buildings destroyed), C (many buildings considerably damaged, some collapse), D (damage to poorly constructed buildings), and E (no destruction of buildings). Write the agenda to categorize the Ritcher scale!



Notes :

  • Is it enough to use only if-else structure to solve the previous problem?
  • We need more than one alternative to categorize the Ritcher scale.
  • Solution: use multiway if-else or nested if


Algorithms of Multiway IF – ELSE 


We can use multi-way IF – ELSE if there are several alternatives that are needed to be chosen by our algorithm. 

IF (conditions) then steps 
ELSE-IF (conditions) then steps 
… 
… 
... 
ELSE stepsFlowchart: Multiway IF – ELSE 

Flowchart of Multiway IF – ELSE




Multiway IF – ELSE Example



Algoritmic Table



Flowchart






Nested IF

Nested IF is an if statement inside another. Any persoalan that involves a multiway IF – ELSE can be solved using Nested IF. Furthermore, there are no differences between multiway IF – ELSE and Nested IF

Nested IF Example



Examples

Tax Regulation

Write an algorithm and draw the flowchart to calculate the income tax based on this regulation!



Algorithm: Tax Regulation



Exercise 1


Salary

You are given the salaries of these 3 employees working in the accounts department. You have to find out the minimum salary of those employees. Write the algorithms and draw the flowchart!



The Colors

In RYB colors, there are three primary colors: red, blue, and yellow. We can make a secondary color by mixing up two primary colors. We can create green by mixing up the blue and the yellow. The orange is created by mixing up red and yellow. The purple is created by mixing up red and blue. 

Given two primary colors, make an algorithm to find out what is the secondary color created by those primary colors !




Leap Year

Write an algorithm and draw the flowchart to determine if a year is a leap year. A leap year is a calendar day containing one additional day. These extra days occur in years which are multiples of four (with the exception of years divisible by 100 but not by 400).





Zapping

My TV remote is almost broken. Only △ and ▽ are working. My TV has 100 channels conveniently numbered 0 through 99. They are cyclic, in the sense that if I’m on channel 99 and press △ I’ll go to channel 0. Similarly, if I’m on channel 0 and press ▽ I’ll change to channel 99. I would like a agenda that, given the channel I’m currently watching and the channel I would like to change to, tells me the minimum number of button presses I need to reach that channel. 

Write the algorithm and draw the flowchart!



How Old Are You

Given two dates: current date and a birth date of a person. Write your algorithm and draw the flowchart to calculate how old a person is! Assume that there are no invalid date (current date is < birth date). 

Example: 
  • Current Date: 12/11/2007 
  • Birth Date: 01/01/1984 
  • Age: 23


Chocolate Bar



We want to make a package of goal kilos of chocolate. We have small bars (1 kilo each) and big bars (5 kilos each). Count the number of small bars to use, assuming we always use big bars before small bars. Output -1 if it can't be done. 

Example : 



Sumber http://wikiwoh.blogspot.com

Friday, November 23, 2018

Matematika Diskrit : Hukum-Hukum Aljabar Himpunan, Prinsip Inklusi Dan Eksklusi, Dan Pembuktian Proposisi Himpunan

Matematika Diskrit : Hukum-Hukum Aljabar Himpunan, Prinsip Inklusi dan Eksklusi, Pembuktian Proposisi Himpunan, dan Contoh Soal





HUKUM-HUKUM ALJABAR HIMPUNAN DAN DUALNYA

Hukum identitas










Hukum null/dominasi










Hukum komplemen











Hukum idempoten 










Hukum involusi 








Hukum penyerapan (absorpsi)











Hukum komutatif  








Hukum asosiatif 








Hukum distributif







Hukum De Morgan 









Hukum 0/1 (atau aturan tambahan 2)










PRINSIP EKSKLUSI DAN INKLUSI

1. Misalkan A dan B yaitu himpunan berhingga yang saling lepas (disjoint), maka




2. Misalkan A dan B yaitu himpunan berhingga, maka 

          




berhingga dan






3. Misalkan A, B, dan C yaitu himpunan berhingga, maka 





berhingga dan




Latihan 1



Dalam suatu survey pada 60 orang, didapatkan hasil bahwa 25 orang membaca majalah Elle, 26 orang membaca majalah Gadis, dan 26 orang membaca majalah Femina. Juga terdapat 9 orang membaca majalah Elle dan Femina, 11 orang membaca majalah Elle dan Gadis, 8 orang membaca majalah Gadis dan Femina, dan 8 orang tidak membaca majalah apapun. 

Berapa banyaknya orang yang membaca majalah Elle, Gadis, dan Femina sekaligus ?


PEMBUKTIAN PROPOSISI HIMPUNAN



Pembuktian dengan Diagram Venn 



Misalkan A, B, dan C yaitu himpunan. Buktikanlah

Caranya :


  • Gambarlah Diagram Venn pada satu proposisi. 
  • Kemudian Gambarlah Proposisi Kedua
  • Bandingkanlah !

Pembuktian dengan tabel keanggotaan

Misalkan A, B, dan C yaitu himpunan. 

Buktikan



Caranya :




Pembuktian dengan aljabar himpunan 


Misalkan A, B, dan C yaitu himpunan

Buktikan 



Bukti :




Latihan 1

Buktikan untuk himpunan A, B, dan C, bahwa :






Sumber http://wikiwoh.blogspot.com

Latihan Soal Pemodelan Untuk Komputasi : Computational Thinking Ii

Latihan Soal Pemodelan untuk Komputasi : Computational Thinking II




Platform Length

A train passes a station platform in 36 seconds and a man standing on the platform in 20 seconds. If the speed of the train is 54 km/h, what is the length of the platform ? 



Train Passing

Train travelling at a speed of 8 km/h enters a tunnel 3 km long. The train is 1 km long. How long does it take for the train to pass through the tunnel from the moment the front enters to the moment the rear emerges? 



Man on a Box

A box having a length 3 m and breadth 2 m is floating on a lake. The box sinks by 0.01 m when a man gets on it. The density of the water of the lake is 1000 Kg/m3. What is the mass of the man?



Hello From Another Plane !!

Bob departed from Jakarta to Bandung at the same time as Alice departed from Bandung to Jakarta. The distance from Jakarta to Bandung is 170 km. If Bob’s average speed is 80 km/h and Alice’s average speed is 90 km/h. How long does it take for Bob and Alice to meet?



Speed Up

A car traveled from Jakarta to Padalarang in 5 hours. Then the car traveled back from Padalarang to Jakarta in 4 hours. If the distance between Jakarta and Padalarang is 160 km then how much speed increase did the car was needed to make on the second journey compared to the first journey? 



Coin Change

Every candy shop in Wombat Land always have 3 stacks of coins for change: W$100, W$50, and W$25. A customer came to one of the shop. She paid with W$500 coin for a W$325 worth candy bag. How many coins did she get as change? 




Magic Number #1

A two-digit number is such that the product of the digits is 8. When 18 is added to the number, then the digits are reversed. What number is it? 



Magic Number #2

The sum of the digits of a two-digit number is 15 and the difference between the digits is 3. What is the two-digit number?


The Chosen 4

In a group of 6 boys and 4 girls, four children are to be selected. In how many different ways can they be selected such that at least one boy should be there? 




More Water Please !

In a mixture 60 litres, the ratio of milk and water is 2 : 1. If this ratio is to be 1 : 2, then what is the quantity of water to be further added ? 














Sumber http://wikiwoh.blogspot.com

Laptop Graphic Terbaik Untuk Desain Grafis 2014

Mereview Laptop Desain Grafis tahun 2014 OPOSIP - Ketika saya bekerja dari rumah saya mempunyai sebuah PC yang didedikasikan yang sang...