Is mathematics used more or logic used more in programming?

  • (4 Pages)
  • +
  • 1
  • 2
  • 3
  • 4

54 Replies - 2176 Views - Last Post: 05 January 2020 - 12:48 AM

Poll: What is used more in programming? (2 member(s) have cast votes)

Does progamming use mathematics more or logic more?

  1. Mathematics (0 votes [0.00%])

    Percentage of vote: 0.00%

  2. Logic (1 votes [50.00%] - View)

    Percentage of vote: 50.00%

  3. No (1 votes [50.00%] - View)

    Percentage of vote: 50.00%

Vote

#31 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 15488
  • View blog
  • Posts: 62,032
  • Joined: 12-June 08

Re: Is mathematics used more or logic used more in programming?

Posted 04 January 2020 - 07:56 PM

Who said you were Indian? :rolleyes2:
Was This Post Helpful? 0
  • +
  • -

#32 jon.kiparsky   User is offline

  • Beginner
  • member icon


Reputation: 11768
  • View blog
  • Posts: 19,977
  • Joined: 19-March 11

Re: Is mathematics used more or logic used more in programming?

Posted 04 January 2020 - 08:04 PM

View PostnoviceFedora, on 04 January 2020 - 09:51 PM, said:

What is the reason for using "Big Cows"? Is it offend me as I'm from India? And people here are believed to consider cows sacred?


Why would I want to offend you? What joy would that bring me?
Was This Post Helpful? 0
  • +
  • -

#33 noviceFedora   User is offline

  • New D.I.C Head

Reputation: -4
  • View blog
  • Posts: 44
  • Joined: 08-December 19

Re: Is mathematics used more or logic used more in programming?

Posted 04 January 2020 - 09:16 PM

View Postmodi123_1, on 04 January 2020 - 07:56 PM, said:

Who said you were Indian? :rolleyes2:/>/>


I'm sure the IP which you see when I log in would have given you enough information to conclude I'm from India. I thought it was accessible to administrators and moderators and this information might have been shared with members, etc.

This post has been edited by noviceFedora: 04 January 2020 - 09:17 PM

Was This Post Helpful? 0
  • +
  • -

#34 noviceFedora   User is offline

  • New D.I.C Head

Reputation: -4
  • View blog
  • Posts: 44
  • Joined: 08-December 19

Re: Is mathematics used more or logic used more in programming?

Posted 04 January 2020 - 09:23 PM

View PostSkydiver, on 04 January 2020 - 12:55 PM, said:

Just like a person crossing the street looks at the oncoming cars is not doing differential equations to make sure that they don't hit by a bus or a car.

Or a carpenter trying to build a book case is not doing integral calculus to figure out how much wood he needs.

Or a taxi driver trying to figure out the fastest way to get his customer to their destination is not applying graph theory.

Or a criminal who is being offered a deal by the prosecutor to rat out on his cohorts is not using game theory.

Or a lawyer is trying to parse out all the IFs, WHEREAS, ANDs, ORs, EXCEPTs in a legal statute is not using logic and set theory.

Nope... none of those people are using math at all. :)/>/>



View Postmacosxnerd101, on 04 January 2020 - 02:53 PM, said:

I'm so glad we don't have people like Number Theorists and Cryptographers thinking about how to securely send information. It's not like folks buy things online.

And it's a great thing nobody thinks about how to recover messages from damaged transmissions. I really love when my calls get dropped, or when I can't understand a word the other person is saying. I'm glad math folks don't work in the area of error correcting codes.

Yep- all those mathematicians just mindlessly push numbers around all day, not impacting the lives of the "real world" folks at all.


So in the software you are alluding to, how many lines of code does math(as in calculations, etc) take up and how many lines of code in those software is made up of creative combination of a programming languages' keywords? I'm guessing math takes up just around 30% and programming keywords take up 70%.

Again by math I confine it to calculations, etc.
Was This Post Helpful? 0
  • +
  • -

#35 jon.kiparsky   User is offline

  • Beginner
  • member icon


Reputation: 11768
  • View blog
  • Posts: 19,977
  • Joined: 19-March 11

Re: Is mathematics used more or logic used more in programming?

Posted 04 January 2020 - 09:42 PM

View PostnoviceFedora, on 04 January 2020 - 11:23 PM, said:

So in the software you are alluding to, how many lines of code does math(as in calculations, etc) take up and how many lines of code in those software is made up of creative combination of a programming languages' keywords? I'm guessing math takes up just around 30% and programming keywords take up 70%.

Again by math I confine it to calculations, etc.


You seem to be missing the point, or rather several points. In quick order, they are:
- it's silly to speculate about the content of programs that I haven't read.
- lines of code are not a useful indicator of much of anything.
- trying to divide up lines of code in the manner you're suggesting is meaningless, since
-- code that is doing calculations is expressed in "creative combinations of programming languages' keywords" and
-- every expression in a programming language ultimately implies a great number of "calculations"
-- the programs we're talking about simply wouldn't exist without the math, so even if you could distinguish the one from the other, it'd be like arguing that the most important part of a car is the upholstery on the seats, since there's more of that by volume than, say, the engine

At least, these are the ones I noticed off hand. I'm sure there are others I've missed.
Was This Post Helpful? 3
  • +
  • -

#36 Skydiver   User is online

  • Code herder
  • member icon

Reputation: 7230
  • View blog
  • Posts: 24,513
  • Joined: 05-May 12

Re: Is mathematics used more or logic used more in programming?

Posted 04 January 2020 - 10:14 PM

I think noviceFedora is arguing that there is no math at all that goes into writing:
10 PRINT "HELLO, WORLD"



I don't think he realizes that a lot of math that goes into making a Turing machine that can interpret and run that single line of BASIC code.

It's just like I find it extremely overwhelming to think about the amount of physics, chemistry, engineering, electronics, materials science, ergonomics, psychology, and mathematics used by those sciences that let me simply turn on the ignition of my car, step on the gas pedal, and turn the steering wheel when I drive my car.
Was This Post Helpful? 1
  • +
  • -

#37 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12680
  • View blog
  • Posts: 45,864
  • Joined: 27-December 08

Re: Is mathematics used more or logic used more in programming?

Posted 04 January 2020 - 10:40 PM

@noviceFedora- How would one design cryptosystems like Rijndael, RSA, or elliptic-curve cryptosystems without the math? How would one even know what what commands needed to be included in a Java or Python implementation without the math? How would one convince folks that these cryptosystems are secure without a formal mathematical proof?

This post has been edited by macosxnerd101: 04 January 2020 - 10:45 PM

Was This Post Helpful? 2
  • +
  • -

#38 noviceFedora   User is offline

  • New D.I.C Head

Reputation: -4
  • View blog
  • Posts: 44
  • Joined: 08-December 19

Re: Is mathematics used more or logic used more in programming?

Posted 04 January 2020 - 10:56 PM

View Postjon.kiparsky, on 04 January 2020 - 09:42 PM, said:

You seem to be missing the point, or rather several points. In quick order, they are:
- it's silly to speculate about the content of programs that I haven't read.
- lines of code are not a useful indicator of much of anything.
- trying to divide up lines of code in the manner you're suggesting is meaningless, since
-- code that is doing calculations is expressed in "creative combinations of programming languages' keywords" and
-- every expression in a programming language ultimately implies a great number of "calculations"
-- the programs we're talking about simply wouldn't exist without the math, so even if you could distinguish the one from the other, it'd be like arguing that the most important part of a car is the upholstery on the seats, since there's more of that by volume than, say, the engine

At least, these are the ones I noticed off hand. I'm sure there are others I've missed.


If you read the OP, you'll remember that I acknowledged that there are certain types of programming which requires math, but most of the programming doesn't. Because of this introducing programming concepts through math in textbooks is counter productive.

By same reasoning we can argue that cooking is chemistry, and medical science is chemistry and chemistry is physics. So chefs and doctors have to have knowledge of physics.

In cars there is more metal but they are so dense that they don't appear to occupy as much as upholstery.
Was This Post Helpful? 0
  • +
  • -

#39 Skydiver   User is online

  • Code herder
  • member icon

Reputation: 7230
  • View blog
  • Posts: 24,513
  • Joined: 05-May 12

Re: Is mathematics used more or logic used more in programming?

Posted 04 January 2020 - 11:05 PM

View PostnoviceFedora, on 05 January 2020 - 12:56 AM, said:

Because of this introducing programming concepts through math in textbooks is counter productive.

Is it? What approach would you then take to explain the concept of variables used in most programming languages? What example code and exercises would you give a student to reinforce that concept of variables?
Was This Post Helpful? 0
  • +
  • -

#40 noviceFedora   User is offline

  • New D.I.C Head

Reputation: -4
  • View blog
  • Posts: 44
  • Joined: 08-December 19

Re: Is mathematics used more or logic used more in programming?

Posted 04 January 2020 - 11:16 PM

View PostSkydiver, on 04 January 2020 - 11:05 PM, said:

Is it? What approach would you then take to explain the concept of variables used in most programming languages? What example code and exercises would you give a student to reinforce that concept of variables?


They can use strings and char. Even basic math can be used for that, like addition, subtraction, multiplication and division. Even in cooking and medicine they use basic math to measure quantities of ingredients, drugs, etc.

This post has been edited by noviceFedora: 04 January 2020 - 11:17 PM

Was This Post Helpful? 0
  • +
  • -

#41 ndc85430   User is offline

  • I think you'll find it's "Dr"
  • member icon

Reputation: 986
  • View blog
  • Posts: 3,883
  • Joined: 13-June 14

Re: Is mathematics used more or logic used more in programming?

Posted 04 January 2020 - 11:17 PM

I disagree that it's counter productive to use arguably quite basic maths to help introduce programming concepts. For a start, if you're focussing on the fact that the problem involves maths too much, you're probably worrying about the wrong thing. The aim of such problems is, well, to help you develop problem solving skills - breaking down the problem into smaller pieces and working out how to do those and combine them into a solution for the whole thing. With temperature conversion, for example, surely you understand the basic symbols for arithmetic and so can read a formula? In the case of modulo division as you mentioned it earlier, if you happen to be in a country that uses the 24 hour clock, every time you read 17:00 as "5 o'clock", you're doing modulo division without knowing. Learning something new can't possibly be a waste of time and you'll probably at least find that modulo division crops up for other problems too.

I sense some amount of aversion to learning here and I think that might be a barrier for your progression.

I'm also now thinking of the intro to the show Numbers (we all use math every day...) and I note the point has been alluded to above.

This post has been edited by ndc85430: 04 January 2020 - 11:19 PM

Was This Post Helpful? 3
  • +
  • -

#42 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12680
  • View blog
  • Posts: 45,864
  • Joined: 27-December 08

Re: Is mathematics used more or logic used more in programming?

Posted 04 January 2020 - 11:19 PM

Quote

Because of this introducing programming concepts through math in textbooks is counter productive.


This is a bold claim that fails to take into account pedagogy and student prerequisites. Here are a couple points to consider.
  • Is it best Math students take an Intro to Programming class that ignores their mathematical background? Does this do an effective job of motivating the material for Math students?

  • In practice, engineers frequently rely on languages such as MATLAB, Maple, and Mathematica to do numerical analysis. As such, they usually have to take an intro to programming course that focuses on numerical methods. Are you suggesting that it is counter-productive to teach the concepts they need with an emphasis on the mathematical and engineering applications?

  • Folks in business have to analyze a lot of data. Would it be counter-productive to teach them programming, with an emphasis on the analytics and statistical applications?



In each of these cases, what pedagogical evidence do you have to support your claims?
Was This Post Helpful? 2
  • +
  • -

#43 noviceFedora   User is offline

  • New D.I.C Head

Reputation: -4
  • View blog
  • Posts: 44
  • Joined: 08-December 19

Re: Is mathematics used more or logic used more in programming?

Posted 04 January 2020 - 11:28 PM

View Postmacosxnerd101, on 04 January 2020 - 11:19 PM, said:

This is a bold claim that fails to take into account pedagogy and student prerequisites. Here are a couple points to consider.
  • Is it best Math students take an Intro to Programming class that ignores their mathematical background? Does this do an effective job of motivating the material for Math students?

  • In practice, engineers frequently rely on languages such as MATLAB, Maple, and Mathematica to do numerical analysis. As such, they usually have to take an intro to programming course that focuses on numerical methods. Are you suggesting that it is counter-productive to teach the concepts they need with an emphasis on the mathematical and engineering applications?

  • Folks in business have to analyze a lot of data. Would it be counter-productive to teach them programming, with an emphasis on the analytics and statistical applications?



In each of these cases, what pedagogical evidence do you have to support your claims?


Let's agree that there are two types of programming textbooks, one for the normal reader, another for students of computer science and similar subjects. Textbooks meant for students of computer science and math can have such things.

The scenarios you've quoted are special, not something an average person would require. MATLAB is a special software and so are Maple and Mathematica. Mathematical students and business people are also different than normal people.
Was This Post Helpful? 0
  • +
  • -

#44 jon.kiparsky   User is offline

  • Beginner
  • member icon


Reputation: 11768
  • View blog
  • Posts: 19,977
  • Joined: 19-March 11

Re: Is mathematics used more or logic used more in programming?

Posted 04 January 2020 - 11:35 PM

View PostnoviceFedora, on 05 January 2020 - 12:56 AM, said:

If you read the OP, you'll remember that I acknowledged that there are certain types of programming which requires math, but most of the programming doesn't. Because of this introducing programming concepts through math in textbooks is counter productive.


Just for kicks, I'll repeat myself again:

Quote

So yeah, start by thinking about logic, but if you don't bump into some math pretty soon you're probably not setting your sights high enough.


Yes, for the novice programmer the imperative logic of the code they're writing is probably the most important thing to be thikning about. We've acknowledged that. Nobody is arguing with you about that.

Now, you say that "introducing programming concepts through math is counter-productive". This might be true, in your case. But traditionally, exercises based on automating arithmetical calculations are pretty common, for some very good reasons which I will list for you.

- traditionally, people involved in programming computers have had an affinity for math. This may not be as true in 2020 as it was in 1980, but it's still not wrong
- even if beginning programmers aren't necessarily mathematically inclined in 2020, programming is becoming a discipline that people take up in high school, and so it's reasonable to expect that a beginning programmer will have recently encountered something like the Pythagorean theorem or solving quadratic equations and be willing to write code about those problems
- calculation exercises are typically amenable to programming solutions. After all, they're sort of the main reason why computers were made in the first place.
- calculation exercises have nice properties for teaching programming, specifically they are self-contained, modularly connective, and make good examples of what functions are and why we write them.

Now, evidently you don't enjoy this sort of exercise. We get that. And there are many programming exercises that you can do where you can pretend that there's no math at all - in fact, there's whole sites for it. But it seems to me that you've taken your personal opinion about one sort of exercise, and in order to defend your opinion - which nobody is trying to take away from you - you're talking yourself into more and more ridiculous claims.

While I in no way want to make an argument from authority, I would suggest that when you are arguing about the nature of mathematics with a professional mathematician, things might have gone a little bit not the way you intended them to. And it's okay to stop and say, okay, maybe I should back down off this one. There's nothing to win here.


Quote

By same reasoning we can argue that cooking is chemistry, and medical science is chemistry and chemistry is physics. So chefs and doctors have to have knowledge of physics.


Oy gewalt, you want me to tilt at your straw man? How about instead I'll raise you one: in order to do anything, in order to even contemplate moving my little finger, I need to have perfect knowledge of every particle in the universe and how my motion will affect it. And yet, I lack that perfect knowledge, and yet I still move my finger - see, I just did! - and it's fine. So maybe your straw man isn't actually a thing. How could that be? Well, just like nobody's going to say that you need a degree in physics to do chemistry (see, you thought you got away with that one, but you didn't), nobody's going to say that you need a degree in chemistry to be a chef. On the other hand, no sane person would deny that a working chef demonstrates a deep understanding of a lot of interesting aspects of chemistry when they prepare 80 covers in a night or plan out a new dish. And no sane person, on thinking about it, would argue that a chef would be hurt by investigating more deeply those aspects of chemistry that they use in their work. In fact, many chefs do study chemistry, informally or formally, and make use of that knowledge in their work. So, yes, chemistry plays into food preparation, and learning more about it is helpful, but no, that doesn't imply that a chef must be a working physicist.
And by the way, you might be surprised to learn that "food chemistry" is a degree that people get, usually in order to work in mass-production of foodstuffs.

Okay, let's rope this back to the subject at hand: nobody has said that you must be a mathematician in order to write computer programs. What we have said is that if you're writing programs, you're certainly going to run into some math, particularly if you want to do anything interesting, and you should probably be prepared for that. I mean, maybe you want to be a front-end peon and write the same javascript every day - okay, fine, very little math there apart from, oh, positioning elements and like that. But if your aspirations involve anything beyond that - even hitting a database (relational algebra) - you're going to be touching some math, and you can either ignore it and make your life harder, or you can embrace it, and maybe learn something.
Was This Post Helpful? 3
  • +
  • -

#45 macosxnerd101   User is offline

  • Games, Graphs, and Auctions
  • member icon




Reputation: 12680
  • View blog
  • Posts: 45,864
  • Joined: 27-December 08

Re: Is mathematics used more or logic used more in programming?

Posted 04 January 2020 - 11:36 PM

Quote

one for the normal reader


What is a normal reader?


Quote

The scenarios you've quoted are special


We have Computer Science folks, Math folks, Business folks, Engineers, and "normal people." I am having trouble understanding what constitutes a "normal" person in your mind. Can you make this notion precise? Is this a populated set?
Was This Post Helpful? 0
  • +
  • -

  • (4 Pages)
  • +
  • 1
  • 2
  • 3
  • 4