Thinking? • Where & when to use Computational Thinking? • Why should we use Computational Thinking? • How to use Computational Thinking? ◦ Print a simple pattern ◦ Binary Search case study (bonus if we have some time left) • What’s next? • Any Questions?
here! My name is Wisnu Adi Nurcahyo and you may call me Wisnu. Technically speaking, I’m already an alumni since I’ve passed my “sidang yudisium”. I’m working as a Software Engineer at Traveloka. I’m not that active on Discord atm but you may ask me programming related stuff. Nice to meet you all!
process consists of four steps. 1. Decomposition 2. Pattern recognition 3. Pattern generalization (abstraction) 4. Algorithm design The main goal is to solve a programming related problems. Or, we can say any problems that can be computed by a computer.
breaking down data. We also identify the components, or smaller parts, of the problem. What we will do are as follows: 1. Define the goal. 2. Set the problem constraints. 3. Divide the problem into several subproblems.
patterns, once we go through the decomposition of problems. Would be great if you able to set the constraints well. There is no “standard” of finding similarity (unless it is a mathematical pattern/sequence). However, I usually do something like this: 1. How it looks like when I have the minimum number of data. 2. How it looks like when I have the maximum number of data. 3. How it looks like when I have a random number of data. 4. What happens if my data is out of the constraints.
best way to improve our hunch while finding pattern is to practice more. Also, do learn some techniques to find mathematical pattern/sequence. It will help a lot!
to go through pattern generalization and abstraction. That is, we want to make sure that the solution we come up with can be used for multiple instances of the problem we have identified. Well, to put it simply, create our own “formula” to handle all kind of conditions within the constraint.
in this step, we try to give the computer our instruction to solve the problem. The algorithm and the data structure used are based on two things: 1. The problem constraints. 2. The pattern generalization.
the formula from the pattern generalization step. Is it as easy as implementing the formula like this? def fib(n): if n == 0 or n == 1: return 1 return f(n - 1) + f(n - 2)
as it is. However, what happens if it is 1000? Your algorithm would take too long to finish. Imagine, the time complexity is O(2^n). You have 1000 so it is 2^1000 which is equal to 10715086071862673209484250490600018105614048117055336074437503883 70351051124936122493198378815695858127594672917553146825187145285 69231404359845775746985748039345677748242309854210746050623711418 77954182153046474983581941267398767559165543946077062914571196477 686542167660429831652624386837205668069376 computations.
second, how many seconds it takes to finish that gigantic number of computations? Then, you need to design a better algorithm! Not that easy, huh? And yeah, this is where the fun begins!
that can be solved by a computer. A programming problem in general could be solved with computational thinking approach. So, yeah, IMO, if you code then you need to know computational thinking or even better, use it. NOTE: Do not involve UI/UX related work.
it easy for you to understand, we will try to solve these following problem: • Print a simple pattern • Binary Search case study (bonus if we have some time left) We will follow computational thinking steps on each problem above.
we will have one single input, n, which is a positive integer based on the sample output (in the left), if n = 5 then we print a pattern with 5 lines it turns out that the number of character in that line is equals with its line number
platform such as TLX, HackerRank, Codeforces, etc. Also, you need to read more about algorithm strategy and data structure. The more “tools” you have, the more options available to solve the problem.