Solving linear Diophantine equation systems {ProjectIn this project, you are going to implement an algorithm that I presentedin class to solve a linear Diophantine equation system in three variablesand with 2 equations. Being Diophantine, the variables are of nonnegativeintegers. You may use C, C++, or Java to do the implementation.I do not ask you to design the algorithm, instead, I present the algorithm’sdesign, and you need only implement the algorithm.You need turn-in working code and prepare for a demo. You have twoweeks to do the project.Preparation 1.Herein, an equation is in the form. ofC1x1 + C2x2 + C3x3 + C = 0 (1)where constants C1;C2;C3 are integers (positive,negative, zero), and constantC is nonnegative. Hence, for instance, 3x1 + 0x2 4x3 17 = 0 is not anequation in the above form. However, equivalently, 3x1 0x2+4x3+17 = 0is in the above form.For the equation in (1), we de neCmax = maxd;d1;d2;d32f0;1gjC1d1 + C2d2 + C3d3 + dj: (2)(Excercise: For the aforementioned equation 3x1 0x2 +4x3 +17 = 0, whatis the value of Cmax?)Implement a function that returns Cmax from the description of an equationin (1), and use the above Excercise to test your function.Preparation 2.For a constant C 0, we use binary representation for C. For instance,if C = 34, then in binary, C = 100010. In this case, we useb6b5b4b3b2b1for it, with b6 = 1;b5 = b4 = b3 = 0;b2 = 1;b1 = 0. Herein, we de ne KC = 6(the number of bits needed to represent C). In particular when C = 0, welet KC = 0.1Hence, for 1 i KC, the bi is de ned as above. However, for i = KC+1,the bi is now de ned as 0. (Excercise: Let C = 18. What is the value of KC?what is the value of b6? what is the value of b4?)Implement a function that returns the value KC from a given constantC 0.Implement a function that returns the value bi from a given constant C 0and i, noticing that the i shall be in the range of 1 i KC + 1.Algorithm 1. Equation to automatonWe now construct a nite automaton M from the description of the equa-tion in (1).The input alphabet of M contains exactly eight input symbols, whereeach symbol is in the form. of (a1;a2;a3) with a1;a2;a3 2f0;1g. (Hence, aninput symbol is a triple of three Boolean values.)A state in M is a pair of values: [carry;i], whereCmax carry Cmax;recalling that Cmax is de ned in (2), and 1 i KC + 1.The initial state in M is [carry = 0;i = 1]. The accepting state is[carry = 0;i = KC + 1].For all states [carry;i] and [carry0;i0] and all input symbols (a1;a2;a3),the following is true:[carry;i](a1;a2;a3) ! [carry0;i0] is a transition in M (i.e., M moves from state[carry;i] to state [carry0;i0] on reading input symbol (a1;a2;a3)) i the fol-lowing is true:Let R = C1a1 +C2a2 +C3a3 +bi +carry. Then, R is divisible by2, and carry0 = R2 . Furthermore, if 1 i KC, then i0 = i + 1,else i0 = i. (You shall use the functions implemented above toimplement this step; e.g., to compute the bi.)Implement a function that returns the nite automaton M from the de-scription of an equation in (1). Notice that you shall use a graph as thedata structure of the automaton M. (The automata we constructed are alldeterministic by de nition.)2Algorithm 2. Cartesian product of automataNow we are given a system of 2 equations over three variables x1;x2;x3,where we use E1(x1;x2;x3) and E2(x1;x2;x3) to indicate the two equationsand recall that the equations are in the form. of (1). Suppose that, using theAlgorithm 1 presented earlier, we obtain nite automata M1 and M2 from thetwo equations respectively. Then, we need construct a nite automaton Mto accept the intersection of the language accepted by M1 and the languageby M2. This is a standard algorithm in cpts317. In case that you dont knowit, you can watch https://www.youtube.com/watch?v=QSpErcGyXPMImplement a function that returns theMfrom the M1 and the M2 (whichare computed using the function implemented in Algorithm 1 from descrip-tions of the two equations). Again, the resulting automatonMuses a graphas its data structure.Final step.If the language accepted by M is empty, then the equation system doesnot have solutions;If the language accepted byMis not empty, then we can nd a solution byusing DFS on the graph of theM(from initial to accepting while collectingthe sequence of input symbols on the path). Notice that you shall reverse thesequence and then convert it into digit before you output the solution. I willsketch a little more detail of this step. Suppose that the following sequenceof input symbols is collected on a path from the initial to the accepting:(1;0;1);(0;1;1);(1;0;0);(1;1;0)then, what is the solution to the equation system? it is 1011, 0101,1100 (how did I do it? I got 1011 by picking the rst bit from each inputsymbol in the sequence!). After reversing them, I have 1101, 1010, 0011.Then I convert them into digits: 13, 10, 3. Hence, the solution is actuallyx1 = 13;x2 = 10;x3 = 3.Emptiness testing for the language accepted byMcan be done by runningDFS on the graph of theM(from initial to accepting) { this is also a standardalgorithm in cpts317. DFS is covered in one of cpts121, 122, 223.Please also implement this nal step and use the following two to testyour code:1. The following equation system does not have nonnegative integer solutions:3x1 2x2 + x3 + 5 = 06x1 4x2 + 2x3 + 9 = 032. The following equation system does have solutions:3x1 2x2 x3 + 3 = 06x1 4x2 + x3 + 3 = 0=============================Summary: we can generalize the algorithms to any linear Diophantineequation (and inequalities) system with any number of equations and anynumber of variables. However, this small project is intended for trainingpurposes and hence we only deal with two equations and three variables |-but the algorithm is general.The entire project should be implemented within 600 lines of code (maybe even less). To be successful in this project, you shall be really uent inplaying with pointers, graphs and algorithms on graphs (cpts350).本团队核心人员组成主要包括BAT一线工程师,精通德英语!我们主要业务范围是代做编程大作业、课程设计等等。我们的方向领域:window编程 数值算法 AI人工智能 金融统计 计量分析 大数据 网络编程 WEB编程 通讯编程 游戏编程多媒体linux 外挂编程 程序API图像处理 嵌入式/单片机 数据库编程 控制台 进程与线程 网络安全 汇编语言 硬件编程 软件设计 工程标准规等。其中代写编程、代写程序、代写留学生程序作业语言或工具包括但不限于以下范围:C/C++/C#代写Java代写IT代写Python代写辅导编程作业Matlab代写Haskell代写Processing代写Linux环境搭建Rust代写Data Structure Assginment 数据结构代写MIPS代写Machine Learning 作业 代写Oracle/SQL/PostgreSQL/Pig 数据库代写/代做/辅导Web开发、网站开发、网站作业ASP.NET网站开发Finance Insurace Statistics统计、回归、迭代Prolog代写Computer Computational method代做因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:[email protected] 微信:codehelp QQ:99515681 或邮箱:[email protected] 微信:codehelp