Chủ Nhật, Tháng Hai 5, 2023
  • Home
  • Health
  • News
  • Software
  • Tech
  • Travel
  • Gen Z
NATuts
  • Home
  • Health
  • News
  • Software
  • Tech
  • Travel
  • Gen Z
No Result
View All Result
NATuts
  • Home
  • Health
  • News
  • Software
  • Tech
  • Travel
  • Gen Z
No Result
View All Result
NATuts
No Result
View All Result
Home Tech

What are the benefits of being good at Math in Programming?

25 Tháng Sáu, 2022
in Tech
0
What are the benefits of being good at Math in Programming?
585
SHARES
3.2k
VIEWS
Share on FacebookShare on Twitter

Many of you when you first start learning programming often ask the question: Does learning programming need to be good at MATH?.

In general, to learn programming, we don’t need to be too good at Math, but you also have to know at a basic level, this problem CTV Le Dinh Hoang Vu It was made very clear in the previous post.

But if you are good at Math, it will certainly save you a lot of time and effort when you start “coding”.

To understand specifically the role of Mathematics in the programming profession, first, we need to understand what programming is?

#first. What is programming?

Life is full of problems that need to be solved. And to solve it, we can do it “manually” by hand or by machine.

However, there are repetitive jobs, or jobs that need to be calculated on a large scale, if done manually, it will be very resource-intensive, time-consuming and generally “useless”.

Then, programming will help us solve that problem more effectively, saving time and effort.

So to understand it roughly: Programming is the practice of instructing a computer to perform various tasks and jobs in a language it understands.

The language that the computer understands is called . programming language.

In order for the computer to do the job correctly, we must come up with a correct way of doing it, including clear steps, which is called algorithm. So to program we need two things, which are: Programming languages ​​and algorithms.

#2. Programming language

There are many popular programming languages ​​these days and it is not difficult to get access to these languages ​​through documents, books or even courses on Youtube.

Learning a programming language also depends on the purpose of programming. You can refer to the number of people using languages ​​through the following table:

English

In general, learning a programming language does not depend much on whether you are good at Math or not.

However, as I said at the beginning of her writing, you should also know the basics of Math so that while approaching a new programming language, you can practice the “code” of that language through lessons such as: Finding numbers maximum, sum of arrays, etc.

Next, we come to the most important part of this article, which is algorithms and the application of Mathematics to algorithm research.

#3. What is the benefit of being good at Math when making an algorithm?

With that said, an algorithm is a step-by-step process to solve a particular problem. A problem can have many ways to solve, similarly, a problem can have many algorithms to solve. Roughly speaking like this:

English

Consider the simple problem of finding a way from home A come home EASY With the map as shown below, we see there are two ways to handle this problem.

  • Option 1: House A Old house EASY house
  • Option 2: House A BO’s house EASY house E .’s house EASY house

Obviously, if we put the problem in practice, then Way 1 It will save time, effort and save a lot of gas money.

Similarly, in programming we also have many algorithms to solve a problem, but people always want to find the best algorithm to solve the problem, in order to save time. time.

A problem solved with the right algorithm can only take a few seconds to produce a result. Meanwhile, the same problem, but with a bad algorithm, it can take up to a few minutes to perform.

=> Then being good at Math plays a very important role in finding the optimal algorithm.

There are two reasons:

  • Firstly, people who are good at Math are often very good at logical thinking, so the algorithms they find are also “better” than those who are not good at math.
  • Second, people who are good at Math will handle problems in an academic way rather than trying thousands of tests.

I will illustrate specifically for you through some of the following problems: (I will use Python language – a very popular language today).

#4. The problem of calculating the sum of regular numbers

Sum of word numbers 1 arrive n and print to the screen.

For this problem, the simplest way is to use loop for (or conditional loop while) like the following code:

However, if you are good at Math, you will immediately know the formula:

Then, you can “code” two lines to get the following result:

world-renowned-for-the-nao-in-listening-lap-trin (3)

Another example is the problem Sum of squares from 1 to: If we do it in a simple way using a for loop, we have the following code:

world

However, if you know the formula, we have a shorter code like this:

World-class

#5. Math problems with large numbers

Problem: Input from the keyboard positive integer ntell me how many of the numbers end in 0.

If you are not good at Math, you can do it manually by running a loop for and of course the code will be long and the result will run longer like this:

world-renowned-to-be-revealed (6)

But if you’re good at Math, it won’t be hard for you to spot:

And from above, since the product always contains 2.5, it always ends with 0. So the result of the above problem is (if n > 4)

07

You can see that if you enter from the keyboard a very large number, such as n = 10000, the first way the machine will run for a long time, but the second way, the results will be almost instantaneous.

#6. summary

Well, then obviously being good at Math will have a lot of advantages in programming right?! Being good at Math not only produces faster results, but the length of the code is also shorter and more optimized.

I just took two simple examples so that you can easily imagine, in reality there are many more complex problems like that.

If you are not good at Math, you can still program, but the algorithm you give can be very complicated in some cases where people who are good at Math can come up with a much more concise algorithm.

Some simple math problems like in #5, if you do it manually, the results may take a long time (with a very large number of keyboard inputs), but if you have a little thought, the results will come out. almost immediate results.

In short, people who are not good at Math can still program, but will lose more than those who are good at Math. So to be effective when coding, you should develop more in Math.

CTV: Vo Thinh Phat – Blogchiasekienthuc.com
Edit by Kien Nguyen

The article achieved: 3/5 stars – (There are 2 reviews)

Note: Was this article helpful to you? Don’t forget to rate the article, like and share it with your friends and family!

Các bài viết liên quan:

How to get travel insurance

Guide on how to get travel insurance with 4 options

24 Tháng Một, 2023
Software Asset Management for Websites: How to Keep Your Sites Running Smoothly

Software Asset Management for Websites: How to Keep Your Sites Running Smoothly

8 Tháng Một, 2023
5 Best Software to Stream Games

5 Best Software to Stream Games

2 Tháng Một, 2023
IBM Bridge To Cloud For Power

IBM Bridge To Cloud For Power- Everything You Should Know

2 Tháng Một, 2023
Top 10 CRM Software For Construction 

Top 10 CRM Software For Construction Enterprises All The Time

31 Tháng Mười Hai, 2022
What Is IBM Software

What Is IBM Software? 4 Business Segments at IBM You Should Know

26 Tháng Mười Hai, 2022
Previous Post

Download Corel Painter 2023 – Detailed installation instructions

Next Post

100+ Beautiful Good Morning Images

Megusta

Megusta

Related Posts

5 Best Software to Stream Games

5 Best Software to Stream Games

2 Tháng Một, 2023
Top 10 CRM Software For Construction 

Top 10 CRM Software For Construction Enterprises All The Time

31 Tháng Mười Hai, 2022
Instruction how to use OBS streaming software

Features, settings and how to use OBS streaming software through 9 simple steps

25 Tháng Mười Hai, 2022
What is Trans woman?  What is Transgender Women?

What is Trans woman? What is Transgender Women?

23 Tháng Mười Hai, 2022
Christmas gift: Genuine Windows 10 Pro for only $6.63 and Office 2021 for $14.22

Christmas gift: Genuine Windows 10 Pro for only $6.63 and Office 2021 for $14.22

22 Tháng Mười Hai, 2022
How to get 50 free coins of SkyJoy App to redeem

How to get 50 free coins of SkyJoy App to redeem

21 Tháng Mười Hai, 2022
Load More
Next Post
100+ Beautiful Good Morning Images

100+ Beautiful Good Morning Images

Trả lời Hủy

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *

Bài viết mới

How to get travel insurance
Đời sống

Guide on how to get travel insurance with 4 options

24 Tháng Một, 2023
Software Asset Management for Websites: How to Keep Your Sites Running Smoothly
Phần mềm

Software Asset Management for Websites: How to Keep Your Sites Running Smoothly

8 Tháng Một, 2023
5 Best Software to Stream Games
Software

5 Best Software to Stream Games

2 Tháng Một, 2023
IBM Bridge To Cloud For Power
Software

IBM Bridge To Cloud For Power- Everything You Should Know

2 Tháng Một, 2023
Top 10 CRM Software For Construction 
Tech

Top 10 CRM Software For Construction Enterprises All The Time

31 Tháng Mười Hai, 2022
What Is IBM Software
Software

What Is IBM Software? 4 Business Segments at IBM You Should Know

26 Tháng Mười Hai, 2022
W3Schools

Ads

Contact: [email protected]

DMCA.com Protection Status

Categories

  • Android
  • Cạm bẫy tâm lí
  • Chưa được phân loại
  • Đồ họa
  • Đời sống
  • Gen Z
  • Health
  • iOS
  • Kĩ năng mềm
  • News
  • Nhà mạng
  • Phần mềm
  • Phần mềm đồ họa
  • Review sách
  • Software
  • Tech
  • Thiết kế ảnh
  • Thiết kế video
  • Thủ thuật
  • Travel
  • Văn hóa Nam Bộ
  • Văn học
  • Window

Browse by Tag

ai là triệu phú android Apple browser Bullet Journal bản thân chai pin Chỉnh ảnh data domain download fshare game game show giả lập màu hosting IKEA ios khuyến mãi kinh doanh kiến thức kiểm tra pin messenger miễn phí mua sắm Máy ảnh mạng network nghệ thuật ngôn ngữ nhà Trần pin laptop quảng cáo tiếng anh trạng thái Trần Thủ Độ tên miền tắt hoạt động từ vựng video viettel window 10 word zalo Đơn giản

Recent News

How to get travel insurance

Guide on how to get travel insurance with 4 options

24 Tháng Một, 2023
Software Asset Management for Websites: How to Keep Your Sites Running Smoothly

Software Asset Management for Websites: How to Keep Your Sites Running Smoothly

8 Tháng Một, 2023

Trang tin nóng hổi - vừa thổi vừa xem

No Result
View All Result
  • Home
  • Health
  • News
  • Software
  • Tech
  • Travel
  • Gen Z

Trang tin nóng hổi - vừa thổi vừa xem