Improve your Logical Thinking like a Pro! | Logical Thinking Guide for Programmers | Tamil
Summary
TLDRThis video explores how to enhance logical thinking skills as a programmer. It begins with a riddle demonstrating how fast, instinctive thinking can lead to mistakes. The speaker emphasizes the importance of deliberate, slow thinking for coding, using tools like pen and paper, and practicing on platforms like LeetCode. The video covers strategies such as first principles thinking, solving problems methodically, and learning from others’ code. It also highlights the importance of community, continuous practice, and adapting to evolving technologies like AI and Web 3.0 to stay relevant in the field.
Takeaways
- 🧠 Logical thinking can be improved with practice, similar to how solving numerous coding questions enhances problem-solving skills.
- 💡 The 'bat and ball' problem illustrates how our fast brain can lead us to incorrect conclusions, emphasizing the need for deliberate thinking.
- 📝 Pen and paper are essential tools for clear thinking and problem analysis in programming, used by both junior and senior engineers.
- 🚀 The brute force method provides a simple solution to problems but is often inefficient compared to optimized approaches like those found in DSA.
- 🔍 First principles thinking involves breaking down complex problems into simpler, manageable parts to find effective solutions.
- 🧩 Practicing on platforms like LeetCode and GeeksforGeeks helps in picking the right problems and building logical thinking skills.
- 📚 Familiarity with data structures and algorithms (DSA) is crucial for optimizing problem-solving approaches in programming.
- 👀 Observing and learning from others' code, such as seniors or online discussions, can significantly enhance one's coding abilities.
- 🌐 Understanding the evolution of computer science and technology, from the first computers to AI and Web 3.0, is essential for modern programmers.
- 🤝 Joining coding communities and engaging with peers who have a growth mindset can further improve coding skills and foster innovation.
Q & A
Why is the price of the ball not 10 rupees?
-The price of the ball is not 10 rupees because the problem states that the bat is 100 rupees more expensive than the ball. If the ball were 10 rupees, the bat would be 110 rupees, making the total 120 rupees. The correct solution is 5 rupees for the ball and 105 rupees for the bat, adding up to 110 rupees.
What is the main reason people make mistakes on simple math problems like the bat and ball problem?
-People often make mistakes on simple math problems because their fast brain jumps to conclusions without fully analyzing the problem. This leads to incorrect answers, as the fast brain prioritizes speed over accuracy.
How can practicing coding problems improve logical thinking?
-Practicing coding problems can improve logical thinking by training the brain to analyze and break down problems systematically. Repeated exposure to different problem types helps develop problem-solving strategies and enhances cognitive abilities.
What is the brute force method in problem-solving?
-The brute force method involves trying all possible solutions to find the correct one. It is often the simplest approach but can be inefficient for complex problems.
What is the optimized approach in problem-solving?
-The optimized approach uses algorithms and data structures to find solutions more efficiently than brute force methods. Examples include binary search, segment trees, and Fenwick trees, which reduce the number of operations needed to solve a problem.
How does first principles thinking help in problem-solving?
-First principles thinking involves breaking down a complex problem into its most basic elements and solving each element step by step. This approach makes it easier to tackle difficult problems by simplifying them into manageable parts.
What is the importance of using pen and paper in problem-solving?
-Using pen and paper helps clarify thoughts and allows for better visualization of the problem. It aids in organizing information, making it easier to analyze and develop a structured solution.
Why is it important to learn from other people's code?
-Learning from other people's code helps improve your coding skills by exposing you to different techniques and approaches. It also provides insights into best practices and can inspire new ways of thinking about problems.
What is the role of practice in improving logical thinking for programming?
-Practice is crucial for improving logical thinking in programming. Regularly solving coding problems helps reinforce concepts, develop problem-solving strategies, and enhance overall cognitive abilities, making it easier to tackle new challenges.
How can joining coder and doer communities benefit a programmer?
-Joining coder and doer communities provides opportunities for networking, collaboration, and learning. Coders focus on improving their technical skills through coding, while doers bring an entrepreneurial mindset and work on projects, leading to personal and professional growth.
Outlines
🧠 Enhancing Logical Ability Through Practice
The introduction poses a riddle about the price of a bat and ball, demonstrating how quick thinking can lead to incorrect answers. The video aims to show how to improve logical abilities, emphasizing that logical thinking is a trainable skill. It discusses the importance of practice, using platforms like LeetCode or GeeksforGeeks to solve problems, and stresses the balance between coding and thinking. The video will debunk the myth of instant coding seen in movies and highlight the need for thorough thinking and problem-solving strategies in programming.
🛠️ Building Logic: From Brute Force to Optimization
This paragraph introduces the concept of building logic, explaining the difference between brute force and optimized solutions. It gives examples of finding duplicate numbers and generating unique numbers from a set. The section explains the importance of understanding different approaches and using data structures and algorithms (DSA) for optimized solutions. It also touches on human instincts and the evolution of thinking, referencing 'Thinking, Fast and Slow' to highlight the importance of slow, deliberate thinking over quick, instinctive responses.
🔍 First Principles Thinking and Practical Coding Strategies
The discussion continues with first principles thinking, a method of breaking down problems into smaller, manageable parts. It explains how this approach can help in solving complex problems by reducing them to simpler ones. The paragraph emphasizes the importance of pen and paper for clear thinking, and how even senior engineers use these tools. It stresses the value of not reinventing the wheel, using existing solutions and frameworks, and focusing on where to find information rather than trying to know everything. Examples from LeetCode are given to illustrate how complex problems are often combinations of simpler ones.
🦋 Evolution, Coding, and Continuous Learning
This final paragraph draws an analogy between the evolution of the peppered moth and the evolution of computer science. It traces the history of computer science from the first computer to modern technologies like Web 3.0 and AI. The section underscores the importance of continuous coding practice, learning from others, and using platforms like LeetCode and GeeksforGeeks. It also highlights the significance of community involvement, learning from peers, and maintaining a growth mindset. The paragraph concludes with advice on breaking down problems, finding patterns, and consistently practicing to improve logical thinking abilities.
Mindmap
Keywords
💡Logical Ability
💡Fast Brain vs Slow Brain
💡Brute Force Method
💡Optimized Approach
💡First Principles Thinking
💡Data Structures and Algorithms (DSA)
💡LeetCode
💡Factorial
💡Practice
💡Pen and Paper
Highlights
The price of the ball is 5 rupees, not 10, illustrating the importance of slow thinking over fast thinking.
Improving logical ability as a programmer is a trainable skill.
Coders spend 40% of their time coding and 60% thinking about solutions.
Practicing on platforms like LeetCode or GeeksforGeeks can significantly enhance logical thinking skills.
The importance of breaking down problems into smaller, manageable parts using first principles thinking.
The fast brain often leads to errors due to impulsive decisions; the slow brain provides more accurate solutions.
Using pen and paper or a whiteboard is crucial for clear thinking and problem-solving.
Understanding both brute force and optimized solutions for programming problems is essential.
The significance of learning from others' code and continuously adapting and improving your skills.
First principles thinking involves deconstructing a problem into its fundamental elements to solve it effectively.
Programming knowledge is less about knowing everything and more about knowing where to find the information you need.
Leveraging existing solutions and libraries can save time and effort in programming.
The historical example of the peppered moth illustrates how adaptation and evolution can lead to survival advantages.
The progression from early computers to AI and blockchain demonstrates the rapid advancement and impact of computer science.
Consistent practice and problem-solving on coding platforms help maintain and improve programming skills.
Joining coder and doer communities can enhance both coding skills and entrepreneurial growth.
Finding and understanding patterns in problems is key to effective programming.
Transcripts
Hi guys... before starting this video one small question
They are giving you a bat and a ball for 110
the price of the bat is 100 rupees more than the price of the ball
now pause the video and mention the price of the ball in the comments...
did you say it ?
if you said the price of the the ball is ten rupees that is incorrect..
The correct answer is five rupees
If you look at why this is happening because your fast brain works more than your slow brain to give the answer immediately..
That's why this mistake is happening..
If you want to know what the answer is , watch this video completely..
In this video, we will see how you can improve your logical ability as a programmer
and we going to see about completely in this video whether it is trainable skill or not ?
The coding you see in movies, where someone opens a laptop and types code quickly, is not entirely true..
If the coder writes code in a lethargic manner, the entire application may not work properly.
It will crash because most of the answers are attempted to be solved quickly by the fast brain,
The maximum of answers will be incorrect
In the coding programmer will do 40% of coding and 60% of thinking this is the thought process of the many programmers
whether the logical thinking is trainable skill or not ?
I'm not good at math,
but since I have practiced four thousand questions on different coding platforms
I can come up with an idea to solve any type of question given to me. this is basic line for the logical thinking.
Practicing questions can improve your logical thinking and it is a trainable skill..
Before going in-depth into this video, I am making one assumption.
If you know some languages or plan to learn some in the future, I used some terms related to that.
If you don't know about DSA, see my old video.
All the information about DSA is given in that video; check it out.
Step 1 : Picking the right problem to solve is important, so you need to choose the correct set of questions to improve your logical ability .
For this, use the LeetCode or GeeksforGeeks platforms to solve the problems.
choose higher acceptance and easy questions
Choose the type of question you are familiar with: array, string, two-pointer, etc.
First, try to solve those questions,
starting with easy ones, then move to medium difficulty.
coming back to the topic , step 2 Building the logics How to build logic?
You will see one principle later in this video.
Basically, there is one problem that has two types of solutions.
one is brute force and another one is optimise
If someone gives you a problem and you provide a random answer,
that is known as the brute force method.
If i have a set of numbers and ask you to find the duplicate number, what should I say?
You would say, "Check all the numbers; if a number appears again, it will be the duplicate number."
Another question, and you talk about your random approach.
This is a brute force approach
For this question, they have a DSA to provide an optimized approach for the solution.
In this, they use binary search.
Segment tree
Fenwick tree
This are comes under DSA and also has a simple algorithm.
Let's see another example. If i gave you a set of numbers from one to nine,
how many unique numbers can you create from this set?
And you try to calculate the factorial of the numbers.
If we give this problem to a programmer, I already know about the optimized solution.
First, I try to solve it using two numbers.
If there are two numbers, one and two, I can either pick two or not pick it.
approach
If I take three numbers, it means...
approach
So, we get six combinations of numbers.
From this, I can create a pattern.
If there are two numbers, we get two combinations.
With three numbers, we get six combinations.
And for five, we get one hundred twenty as an answer.
Using this pattern, we can easily generate unique numbers from number of digits using the factorial numbers.
Now we are writing the program for the factorial of a number.
This is the formula for the factorial of a number.
and code for this program is....
so this is they way to approach a problems
In this coding, we first need to overcome human instincts.
if people from ancient times heard any footsteps or something, the first thing they would do is not look to see who has come or from where they have come.
Their first instinct was to run away.
This is what the fast brain does
after this, they would use their slow brain to start hunting animals
After that, they began creating shelters
The more we use the slow brain, the more we evolve. We should start using it as little as possible
Where did I get this from? It's from the book "Thinking, Fast and Slow." Check it out
Earlier, I mentioned a problem, and now we'll revisit it
If someone offers you a bat and ball for 110 rupees
and the price of the bat is 100 rupees more than the ball,
what would be the price of the ball?
You would have said it is 10,
but I will prove that it is 5....
here ball is x ,
the bat costs is (X + 100) .....correct
Now, the bat and ball together cost 110 rupees,
it means bat + ball = 110.
Ball is X ,
Bat = X + 100
If we add these three, what will the result be?
2x + 100 = 110
2x = 110 - 100.......2x = 10...........x = 10/2 ........x = 5
If you had think the question a little while ago, you would have known that the price of the ball is 5 rupees.
Your fast brain took over and made you act without thinking
so you need to think like this ...
When you are given any problem or question in an interview, don’t jump straight to the solution.
First, analyze what the problem is, and then analyze the inputs given.
Try to think differently and consider the inputs before jumping to a solution.
Avoid solving any problem without using pen and paper
The more you work on it, the better you will understand the problem.
In our company, whether you are a senior engineer or a junior engineer, we use a whiteboard and pen and paper.
Why? Because a developer's thinking should be clear, and for that, pen and paper are very important.
Why? Because a developer's thinking should be clear, and for that, pen and paper are very important.
If you want to know how to achieve this, there is a strategy called first principles thinking.
What it does is turn a vague problem into a hard problem.
After that, it separate the hard problem into different types of medium problem,
Then the medium problem into an easy problem
If i can solve the easy problem, i can solve the medium problem;
if i can solve the medium problem, i can solve the hard problem
This is what we call first principles thinking.
A great example of this on LeetCode is that most hard questions are essentially a combination of two or three easy questions,
or they may resemble solving two medium-level questions
Most of the LeetCode problems are like this.Try it yourself, and you'll see
In programming, you don't need to know everything.
What's important is knowing where to find what you need when you need it
Don't try to reinvent the wheel. .
If a solution already exists online, use it.
There's no need to write extra code unnecessarily by redoing something that has already been done.
If you want a table, it means someone has already coded it.
Do you need a UI library? It's already coded
Do you need a framework? That's also already coded.
If you need a snippet to solve a problem, it's also already available.
ChatGPT is already working by using all of these.
Use what's already available instead of thinking and typing everything out yourself.
Just try to code new solutions.
I am going to tell you a short story about
how much computer science has affected us and how you can survive in computer science.
The peppered moth was found in England and came in two colors
one with white color and black spots,
and another with black color and white spots.
iThe white moths were more common because and easily hunted one
In the late 1800s, the white moths started to disappear, and the black moths became more common.
Later, they found out that it was because of...
In the 1800s, there was a significant industrial revolution, which created a lot of ash
This change wasn't immediately noticeable because the white trees had turned black due to industrial pollution
As a result, the white moths became easy prey while the black moths thrived
All of them thought it was because of a virus attack, but that was not the reason
Later, when someone used a scrubber to clean the tree,
it turned white, and they discovered that this was due to the industrial revolution
it turned white, and they discovered that this was due to the industrial revolution
Due to evolutionary changes, the number of white moths decreased.
and the black moths became more common
Making it difficult for predators to spot them, because the trees also changed to a darker color.
In the beginning of computer science, discovering the first computer was a significant event,
which was followed by the creation of the internet
and later the advent of Web 2.0, where social media emerged.
Subsequently, artificial intelligence (AI) advanced,
leading to innovations like blockchain for decentralized security.
Now, with Web 3.0
and technologies like Oculus Vision Pro, we are embarking on a journey
where logical thinking combined with programming skills will continue to be essential
Do more coding to improve your skills as a programmer
It's crucial to break down problems and use tools like pen and paper to understand and solve questions effectively.
break your problems down
Use leetcode ,
Try to solve geeks for geek
Try learning DSA as it may improve your thinking as a fresher
Even in work situations, practicing on LeetCode can keep the mind fresh.
However, relying too heavily on it during times of depression might lead to a cycle of worsening feelings hahaha ..
Next, observe and learn from others' code
When I was studying in college, I improved significantly by studying the code of my senior, Charan Sundar.
Upon joining a company, I continued to enhance my skills by adapting and improving upon the codebase of seniors.
During interviews, I go through LeetCode discussion sessions.
I closely observed how they coded and adapted their techniques to improve myself continually.
It's crucial to immerse yourself in coding, learning from others' approaches,
learning from others' approaches, and fostering a growth mindset.
If you are a college student,
join coder and doer communities
Coders focus on doing more coding.
Doers are individuals with an entrepreneurial and growth mindset
They have actually completed many projects
They also attend many symposiums and join those who are innovating
which will improve both your growth and theirs.
In programming, ultimately, it means finding the pattern.
Find that concept and understand it
Finally, code and complete it. That's all!
It is as simple as that
These points will undoubtedly help improve your logical thinking abilities.
Practice consistently and keep progressing
bye.
関連動画をさらに表示
Berpikir Komputasional - Informatika Kelas 7 | Pelajar Hebat
Informatika Kelas 9 Gak Ribet! Pahami Ekspresi dan Operasi Logika | Materi Berpikir Komputasional
Top Skills for AI Era Success
Komputasional...
Systems Thinking Ep. 1: Lists & Models (Learn to think like a genius)
How to Think like A GENIUS Programmer
5.0 / 5 (0 votes)