Exetools  

Go Back   Exetools > General > Community Tools

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 02-05-2020, 22:43
CodeCracker CodeCracker is offline
Family
 
Join Date: Jun 2011
Posts: 296
Rept. Given: 17
Rept. Rcvd 245 Times in 68 Posts
Thanks Given: 12
Thanks Rcvd at 1,001 Times in 221 Posts
CodeCracker Reputation: 200-299 CodeCracker Reputation: 200-299 CodeCracker Reputation: 200-299
LinearDiophantineEq

LinearDiophantineEq: will solve equation a*x+b*y=c
where x and y are integers, nothing special about it.

https://www.techiedelight.com/find-general-solution-linear-diophantine-equation/
https://raw.githubusercontent.com/wandering007/algorithms/master/extended_gcd.cpp
Attached Files
File Type: zip LinearDiophantineEq.zip (4.3 KB, 9 views)
Reply With Quote
The Following User Says Thank You to CodeCracker For This Useful Post:
niculaita (02-18-2020)
  #2  
Old 02-14-2020, 02:49
Git's Avatar
Git Git is offline
Old Git
 
Join Date: Mar 2002
Location: Torino
Posts: 1,095
Rept. Given: 220
Rept. Rcvd 265 Times in 157 Posts
Thanks Given: 86
Thanks Rcvd at 204 Times in 120 Posts
Git Reputation: 200-299 Git Reputation: 200-299 Git Reputation: 200-299
Quote:
Originally Posted by CodeCracker View Post
a*x+b*y=c
where x and y are integers,
Implied, but maybe not obvious that it's more restrictive than that - all four left hand variables muct be integers.

Git
Reply With Quote
  #3  
Old 02-18-2020, 02:09
CodeCracker CodeCracker is offline
Family
 
Join Date: Jun 2011
Posts: 296
Rept. Given: 17
Rept. Rcvd 245 Times in 68 Posts
Thanks Given: 12
Thanks Rcvd at 1,001 Times in 221 Posts
CodeCracker Reputation: 200-299 CodeCracker Reputation: 200-299 CodeCracker Reputation: 200-299
Quote:
Originally Posted by Git View Post
Implied, but maybe not obvious that it's more restrictive than that - all four left hand variables muct be integers.
Git
a, b, c must be also be integers.

One may ask what if x and y are not integers but real numbers,
then we will have an infinite number of solutions:
for each x value there is a y value
and for each y value there is a x value,
which is another way of saying we don't have enough information about x and y from a single equation.
Reply With Quote
The Following User Says Thank You to CodeCracker For This Useful Post:
niculaita (02-18-2020)
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT +8. The time now is 08:13.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX
( 1998 - 2020 )