Wikipedia:Reference desk/Archives/Computing/2017 August 18
Computing desk | ||
---|---|---|
< August 17 | << Jul | August | Sep >> | August 19 > |
Welcome to the Wikipedia Computing Reference Desk Archives |
---|
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
August 18
editpython
editHi everyone,
I just start to learn pythonmand learned about variables, input and basic math.
I been asked to write a mathematical exercise which has the parameters:
ax+by=c
dx+ey=f
a, b, c, d,e, f - the user input and than the program result and write the answear for x, y
I did:
number1 = float(input('Insert a number1: '))
number2 = float(input('Insert a number2: '))
number3 = float(input('Insert a number3: '))
number4 = float(input('Insert a number4: '))
number5 = float(input('Insert a number:5 '))
number6 = float(input('Insert a number6: '))
I do not hoe to write an equation with two variables
x=number1+2.5*number2-number3 (it should be looked like ax+by=c)
y=number5+2.5*number6-number4
I also don't know why I can't write the variable inside print:
print('the value of x, y is') print((x))
can someone help? — Preceding unsigned comment added by 5.102.207.225 (talk) 05:02, 18 August 2017 (UTC)
- You have been given a set of simultaneous equations - in specific, you have a system of linear equations. The most straightforward and simple computer program that can solve for x and y will implement a standard numerical method like Gaussian elimination.
- For a system of two equations, you can write the program for Gaussian elimination using only a few lines of python code. If your teacher wants to extend your program so that it can accept larger numbers of equations, your program will need to be a little bit more sophisticated; and if your teacher wants you to explore the subtle difficult details of advanced computational mathematics - things like "big O()" algorithm complexity or the numerical error of your implementation - then the teacher owes you a few hours of discussion on these difficult topics.
- If you just want to find a reference implementation and copy the code (or study how it works), here is an example implementation written by Isaac Evans, who was a college student at MIT a few years ago. It is a good example for you to read, because it is only a few lines long and is not very complicated. If you were going to make this task part of a larger program, you would probably want to use a much more sophisticated (but harder-to-use) version like the one in BLAS built into NumPy. A note to new students: when you use computers to solve math problems, you need to know about a lot of subtle details - perhaps the most obvious are problems that relate to round-off error, but there are even more subtle issues like division by zero or "matrix singularity" that show up in even simple numerical methods. If you are computing answers that matter - like if you're writing a computer program to solve equations to control a robot arm that would swing wildly if the numbers come out wrong - then these difficult elements of mathematics comprise an entire field of study that you should become aware of.
- Notice that if you use the numerical approach, you "drop" all the variable names and only concern yourself with numerical coefficients, stored as a matrix of numerical data. There are completely different ways to solve these problems - for example, you could use a technique called computational symbolic algebra. This kind of program would keep all the names of the algebra variables around, and would try to give a precise and mathematically exact answer. Those types of software are kind of nice to use - especially if you're a pure mathematician - but compared to numerical methods, that approach would be really hard to write as a python program.
- A general rule for new programmers - and for old programmers, too - before you start trying to write program code to do your task, make sure you know how to do every single step by hand - on paper, or on a chalkboard, for example. Never forget: computer programs do not think - the machine only follows the instructions that you tell it to do. Try to solve for x and y on paper - make sure you know enough about algebra to do that correctly! - and then try to write out every single step you used. That will be your computer program.
- Nimur (talk) 14:56, 18 August 2017 (UTC)
- Heh. If I'd followed that rule, the images in the last column at commons:User:Tamfang would never have been made. Writing the program involved deriving some hairy polynomials using SageMath .... —Tamfang (talk) 23:45, 19 August 2017 (UTC)
Famous/significant IT-related court cases
editLooking for an IT-related court case to write about for a socio-legal research essay. Must be a public court case (i.e. the trial was open to the public and/or media, or was otherwise streamed/recorded and the recording is publicly available; I prefer the former). A case that is well-publicised, controversial, has plenty of both legal and non-legal sources, and that has/may have had significant consequences to (local or international) law or the public is favourable. Can be from any country and at any time (though I would like the cases to be in English). Can be either criminal or civil (non-criminal). List here if you have any in mind. – Pizza1016 (talk | contribs) 11:55, 18 August 2017 (UTC)
- If you want a lot of legal issues, you can look at Internet content lawsuits like Reno v. American Civil Liberties Union or Zeran v. America Online, Inc.. If, instead, you want to get into the controversial stuff, anything involving SCO will do, such as SCO Group, Inc. v. International Business Machines Corp.. 209.149.113.5 (talk) 13:14, 18 August 2017 (UTC)
- I don't know what material is available, but we have these articles Category:United States computer case law and Category:Video game law that may provide inspiration. - X201 (talk) 15:26, 18 August 2017 (UTC)
- From our article on Microsoft: "In 2016, the company sued the U.S., arguing that secrecy orders were preventing the company from disclosing warrants to customers in violation of the company's and customers' rights." The company had earlier been sued for antitrust violations in the US and Europe, particularly bundling products together with the Windows O/S so as to destroy the market for competing products, like web browsers. StuRat (talk) 16:29, 18 August 2017 (UTC)
win32
editWill old win32 programs written for Windows 95 onwards continue to work on modern versions of Windows? I know 16-bit programs no longer work but will 32-bit ones be obsoliete soon too? — Preceding unsigned comment added by 171.33.192.212 (talk) 13:41, 18 August 2017 (UTC)
- Not necessarily. Backwards compatibility is good with Windows, but not perfect. An old game may require some obsolete device driver or system library that is no longer used or supported. Then, the game will fail to work. An option is to use virtual machines to ensure continued compatibility. 209.149.113.5 (talk) 14:03, 18 August 2017 (UTC)
- Since Microsoft still sells 32-bit versions of Windows 10, this seems to be unlikely. Ruslik_Zero 20:48, 18 August 2017 (UTC)
- The WinE might be the better choice for such software. --Hans Haase (有问题吗) 22:23, 18 August 2017 (UTC)
- What I think you're asking is, "Will the Win32 API be deprecated or unsupported any time soon?" The answer to that is a resounding "no." Microsoft ending support for the Win32 API would be on the order of the Internet being turned off. You can't even imagine how much Windows software exists, and virtually all of it is using the Win32 API. Only a small fraction of Windows software has Win64 support. Now, as mentioned above, Win32 API support isn't a guarantee that any old piece of Win32 software will work on a given system. Some old Windows software has issues running on modern Windows, due to using old APIs or other things. But Win32 will probably still be supported long after we're gone, just as IBM z/OS still supports software written for old IBM operating systems dating back to the 1960s. --47.138.161.183 (talk) 07:25, 20 August 2017 (UTC)
- 32-bit programming was mostly phased out because the necessary hardware for typical computer use started hitting the 4 GB (2^32 bytes) RAM ceiling, while the 64-bit ceiling is a long way off. That being said, the compatibility problems can also result from using old deprecated API calls (to Win32 API or calls unsupported by your DirectX version), various tricks workarounds depending on old hardware (e.g. DOS real mode games), or even not being able to detect properly or at all your new hardware (try running GTA IV on a 8 GB GPU). There are possible workarounds (for example, running the game in a virtual machine), but in general, the newer your hardware and your OS is, the less likely will the game be playable. 78.0.246.130 (talk) 00:51, 24 August 2017 (UTC)