Wednesday, July 31, 2019

General psychology Essay

Introduction ALMOST CERTAINLY YOU WILL PROBABLY HAVE COME ACROSS THE IDEA OF PLAGIARISM ALREADY. PLAGIARISM IS ABOUT THE PRESENTATION OF OTHER PEOPLES’ WORK AS IF IT IS YOUR OWN, FOR YOUR GAIN. THE IDEAS AROUND PLAGIARISM ARE PRESENTED TO STUDENTS IN MANY DIFFERENT WAYS – SOMETIMES PLAGIARISM IS SEEN AS A DREADFUL CRIME. WE WANT TO PRESENT IT HERE IN THE CONTEXT OF AN UNDERSTANDING OF ACADEMIC HONESTY AND WHAT IS TERMED ‘ACADEMIC MISCONDUCT’. YOU NEED TO KNOW ABOUT THESE THINGS BECAUSE THEY SHOULD GUIDE YOUR MANNER OF WORKING IN HIGHER EDUCATION. PLAGIARISM AND CHEATING ARE SERIOUS ISSUES IN HIGHER EDUCATION, AND PLAGIARISM, IN  PARTICULAR, IS INCREASING A GREAT DEAL AT PRESENT. WE WANT YOU TO HAVE THE KNOWLEDGE AND SKILLS AND THE GOOD WORKING HABITS THAT ENABLE YOU TO MAKE EFFECTIVE AND APPROPRIATE JUDGEMENTS IN YOUR WORK. THIS UNIT IS DESIGNED FOR STUDENTS NEAR THE STARTING POINT OF HIGHER EDUCATION STUDIES. IT PROVIDES THE INFORMATION AND SKILLS THAT YOU NEED AT PRESENT – AND YOU WILL HAVE MORE MATERIAL ON THIS TOPIC AT A LATER STAGE, WHEN YOU NEED TO KNOW MORE ABOUT IT. The aim of this unit is to: -HELP YOU TO GET A CLEAR IDEA OF ACADEMIC HONESTY AND ACADEMIC MISCONDUCT -CLARIFY THE MEANINGS OF ACADEMIC MISCONDUCT – CHEATING AND  PLAGIARISM AND COLLUSION -PROVIDE YOU WITH INFORMATION THAT YOU NEED IN ORDER TO BE ACADEMICALLY HONEST; -IDENTIFY AND HELP YOU TO ATTAIN THE SKILLS THAT YOU NEED FOR ACADEMIC HONESTY AND GOOD PRACTICE 1 AS WELL AS PROVIDING SOME EXERCISES TO HELP YOU TO LEARN FROM THIS MATERIAL, THIS UNIT IS INTENDED TO BE A RESOURCE TO WHICH YOU MAY WISH TO RETURN FOR GUIDANCE. THE ANSWERS TO THE EXERCISES ARE AT THE END OF THE UNIT. Some points to think about AS A STUDENT YOU SHOULD LEARN ABOUT ACADEMIC HONESTY BECAUSE IT IS AN IMPORTANT ELEMENT OF HIGHER EDUCATION BEHAVIOUR. THERE ARE SEVERAL ASPECTS TO IT. IT INVOLVES: -ENSURING FAIRNESS TO THOSE WHO HAVE PRODUCED NEW KNOWLEDGE AND IDEAS; -ENSURING THAT THE WORK THAT A PERSON SAYS IS HER OWN IS INDEED HER OWN; -THE DISCOURAGEMENT FROM CHEATING TO GAIN UNFAIR PERSONAL ADVANTAGE. THE INTENTION TO DECEIVE STAFF OR THE INSTITUTION IS CENTRAL TO THE ACTIVITY OF THE PLAGIARIST OR CHEAT. HOWEVER, IT IS NOT FAIR ON YOU, AS A STUDENT, IF YOUR FELLOW COLLEAGUES CHEAT AND PLAGIARISE AND THEREBY GET BETTER MARKS. SAM, SUZANNE, IZZY, AND KATRINE ARE IN A LEVEL 1 CLASS AT SOMOUTH UNIVERSITY. THEY ARE ALL STUDYING PSYCHOLOGY AND ARE IN A CLASS OF OVER A HUNDRED AND EIGHTY STUDENTS. THEIR SEMINAR SESSIONS ARE THIRTY IN NUMBER AND SO FAR THEY DO NOT FEEL KNOWN AS INDIVIDUALS BY STAFF. SUZANNE HAS BEEN STRUGGLING BECAUSE SHE, UNLIKE THE OTHERS, DID NOT STUDY PSYCHOLOGY AT SCHOOL. SHE HAS BEEN QUITE DEPRESSED ABOUT IT AND HAS ASKED THE OTHERS FOR HELP. THEY DID WHAT THEY COULD, BUT SHE DID NOT SEEM TO BE ABLE TO TAKE IT IN. AT TIMES SHE TALKS ABOUT LEAVING UNIVERSITY. THEY COME TO THE COURSEWORK ASSESSMENT AT THE END OF LEVEL 1 AND TO EVERYONE’S SURPRISE, SUZANNE COMES OUT WITH ONE OF THE HIGHEST MARKS IN THE CLASS. THE TUTOR PRAISES HER WORK AT THE NEXT SEMINAR AS BEING WELL CONSTRUCTED, AND PARTICULARLY WELL WRITTEN. SUZANNE IS CLEARLY HAPPY AND THEY ALL GO OUT FOR A DRINK IN THE EVENING. UNDER THE INFLUENCE OF A FEW PINTS SHE LETS SLIP THAT SHE PAID ANOTHER STUDENT IN HER HOUSE (FROM LEVEL 2) TO WRITE IT. AFTER THE TIME AND EFFORT THE OTHERS HAVE PUT INTO HELPING SUZANNE, AND DOING THEIR OWN WORK, THE OTHERS FEEL CHEATED BY HER ACTION. THE ATTITUDE TO PLAGIARISM CAN DIFFER IN DIFFERENT CULTURES, FOR EXAMPLE SOMETIMES IT CAN BE CONSIDERED TO BE AN HONOURABLE ACT TO REPRODUCE THE EXACT WORDS OF THE EXPERT TEACHER. IN THE UK THE NORM IS TO EXPECT STUDENTS TO PRODUCE THEIR OWN WORK. THEY WILL, OF COURSE, USE THE WORK OF OTHERS WITHIN THEIR WORK AND WHERE  THIS OCCURS THE OTHERS’ WORK NEEDS TO BE CITED AND WHEN QUOTED, MARKED AS A QUOTATION. SOME INTERNATIONAL STUDENTS MAY NEED TO ADJUST TO UK NORMS WHEN STUDYING HERE. 2 LAU COMES FROM SOUTH EAST ASIA. HE WAS ENCOURAGED TO GIVE GREAT RESPECT TO HIS TEACHERS, THERE AND TO REGARD THEM AS EXPERTS WHOSE WORK WAS TO BE EMULATED. HE IS VERY TAKEN ABACK WHEN HE IS TOLD THAT HIS EXAMINATION PAPER SHOULD EXPRESS MORE OF HIS OWN IDEAS AND SHOULD NOT CONTAIN MATERIAL THAT HE MUST HAVE LEARNT BY HEART FROM HIS LECTURE NOTES. HE FINDS IT HARD TO UNDERSTAND HOW HE, HIMSELF COULD HAVE ANYTHING WORTHWHILE TO SAY AT THIS STAGE. IF YOU ARE AN INTERNATIONAL STUDENT AND FEEL THAT YOU DO NOT UNDERSTAND THE MATERIAL IN THIS UNIT, ASK A TUTOR OR STUDY ADVISOR FOR MORE HELP. Some definitions and explanations WE HAVE SAID THAT THE AVOIDANCE OF CHEATING AND PLAGIARISM IS A MATTER OF HAVING INFORMATION AND A SET OF SKILLS THAT BECOME GOOD HABITS OF WORKING. WE START BY LOOKING AT A SET OF EXPLANATIONS AS PART OF THE INFORMATION, AND THEN YOU WILL BE GIVEN SEVERAL DEFINITIONS. YOU DO NOT NEED TO MEMORISE THESE DEFINITIONS, BUT YOU ARE EXPECTED TO HAVE A WORKING KNOWLEDGE OF THEM. TO START WITH, WE INTRODUCE THE TERM ‘ACADEMIC MISCONDUCT’ TO MEAN THE USE OF  DISHONEST ACADEMIC BEHAVIOUR TO ONE’S OWN BENEFIT. THE TERM INCLUDES CHEATING, PLAGIARISM AND COLLUSION. CLEARLY, SUZANNE ILLUSTRATES ACADEMIC MISCONDUCT IN HER BEHAVIOUR – AND THAT WAS PLAGIARISM. CHEATING IS OFTEN SEEN AS A BEHAVIOUR THAT OCCURS IN EXAMINATIONS, BUT IT IS BROADER THAN THAT. HERE ARE SOME EXAMPLES OF CHEATING BEHAVIOUR. SIMON KNEW THAT OTHERS NEEDED A BOOK IN ORDER TO COMPLETE THE ESSAYS THAT THEY HAD BEEN SET. HE USED THE LIBRARY BOOK HIMSELF, THEN HANDED IT BACK IN (IT WAS A SHORT-TERM LOAN) AND THEN WHEN HE WAS IN THE LIBRARY THE NEXT DAY, TOOK THE BOOK FROM ITS PROPER LOCATION AND PUT IT IN ANOTHER AREA OF THE  LIBRARY. JAMIE WENT INTO THE EXAMINATION WITH TEN KEY NAMES WRITTEN ON HIS ARM IN BALLPOINT PEN JULIETTE WAS DOING A CHEMISTRY DEGREE. HER EXPERIMENT IN CLASS DID NOT GO TOO WELL AND THE DATA SHE ACHIEVED WAS INCOMPLETE. SHE HAD A LOOK AT HER FRIEND’S BOOK AND GOT AN IDEA OF THE APPROPRIATE KIND OF DATA AND MADE SOME UP. CHRISTINA HAD NOT DONE ENOUGH REVISION FOR THE CLASS TEST. SHE TOOK THE DAY OFF, SAYING THAT SHE HAD ‘FLU AND KNOWING THAT SHE WOULD THEN HAVE A BIT MORE TIME TO LEARN FOR THE TEST WHICH SHE WOULD DO LATER. 3 ED HAD A PROJECT IN ENGLISH TO WRITE UP, TO BE HANDED IN AT A PARTICULAR TIME. THERE WAS OTHER ACADEMIC WORK TO BE HANDED IN AT THE SAME TIME AND HE KNEW HE COULD NOT DO ALL OF IT. HE LEFT THE ENGLISH PROJECT UNTIL LAST. AFTER A SESSION IN THE GYM HE COMPLAINED OF A VERY SORE WRIST, PUT A BANDAGE ON IT AND WENT TO SEE HIS TUTOR TO ASK FOR MORE TIME TO COMPLETE THE PROJECT ON THE BASIS THAT HE COULD NOT WRITE VERY QUICKLY AT PRESENT. HIS TUTOR TOLD HIM TO GO TO THE MEDICAL CENTRE AND GET A NOTE. HE CAME BACK TWO DAYS LATER WITH THE PROJECT NOW COMPLETED AND THE WRIST UNBANDAGED AND ‘HEALED’. THE TWO DAYS HAD BEEN VERY USEFUL. ABI WAS ONE OF A GROUP OF STUDENTS WHO WERE WORKING TOGETHER ON A PROJECT  THAT WAS TO BE SUBMITTED JOINTLY. SHE HAD GONE INTO HIGHER EDUCATION PARTLY BECAUSE SHE WANTED TO ENJOY A GOOD SOCIAL-LIFE, AND THE PROJECT WAS NOT GOING TO GET IN HER WAY. WHEN THE OTHER STUDENTS IN THE GROUP MET TO WORK ON THE PROJECT, SHE WOULD CONSTANTLY SAY THAT SHE COULD NOT MAKE IT. THEY GOT ON WITH THE PROJECT, COMPLETED IT AND HANDED IT IN WITH ABI’S NAME ON IT AS WELL. THEY RESENTED HER BEHAVIOUR, BUT BEING IN THE EARLY STAGES OF THEIR PROGRAMME, DID NOT KNOW EACH OTHER VERY WELL AND DID NOT KNOW HOW TO INDICATE ABI’S LACK OF CONTRIBUTION. PLAGIARISM, AS WE HAVE SAID, IS ANOTHER FORM OF ACADEMIC MISCONDUCT AND IT  REQUIRES A RATHER SPECIAL EXPLANATION WHICH IS AS FOLLOWS: THOSE WHO WORK IN HIGHER EDUCATION AND RESEARCH CAN BE SEEN AS WORKING IN A COMMUNITY – THE ACADEMIC COMMUNITY. THIS COMMUNITY HAS A SET OF RULES TO WHICH IT WORKS. ACADEMIC CONVENTIONS ARE THESE RULES AND ACADEMIC MISCONDUCT IS THE BEHAVIOUR THAT CONTRAVENES THESE AGREED RULES. THESE RULES, OBVIOUSLY IDENTIFY CHEATING AS A CONTRAVENTION HOWEVER, THERE ARE ASPECTS OF THESE RULES THAT REFER TO THE ‘OWNERSHIP’ OF IDEAS. ACCORDING TO THESE RULES OR CONVENTIONS, NEW IDEAS ARE TREATED LIKE PROPERTY THAT SOMEONE OWNS. ONE REASON FOR THIS IS THAT THERE ARE REWARDS AND AWARDS (GRANTS, PRIZES, QUALIFICATIONS, DEGREES ETC) GIVEN TO PEOPLE FOR THE QUALITY OF THEIR IDEAS. FOLLOWING FROM THE NOTION OF NEW IDEAS AS PROPERTY, WE CAN CONSIDER THE USE OF UNATTRIBUTED IDEAS FOR THE GAIN OF ANOTHER PERSON, AS A FORM OF THEFT. BY ‘UNATTRIBUTED’, WE MEAN THE LACK OF ATTACHMENT OF A NAME AND SOURCE TO THE IDEA – SO IT IS AS IF THE IDEA IS THAT OF THE WRITER. OTHER WORDS FOR ‘ATTRIBUTE’ ARE REFERENCE, ACKNOWLEDGE AND CITE. YOU USUALLY REFERENCE THE IDEA OF ANOTHER IN THE TEXT (WHERE YOU HAVE REFERRED TO THE IDEA, OR QUOTED FROM IT) AND IN A REFERENCE LIST AT THE END OF YOUR WORK. PLAGIARISM IS THE TERM FOR PASSING OFF ANOTHER’S WORK AS ONE’S OWN FOR ONE’S OWN BENEFIT. IT USUALLY THAT OTHERS’ IDEAS HAVE BEEN ‘BORROWED’ WITHOUT BEING REFERENCED TO THE ORIGINAL CREATOR OF THE IDEA. PLAGIARISM OCCURS WHETHER THE ‘PASSING OFF OF THE WORK AS ONE’S OWN’ IS INTENTIONAL OR UNINTENTIONAL. WE HAVE TO SAY THAT PLAGIARISM MAY BE UNINTENTIONAL BECAUSE ANYONE CAN ALWAYS CLAIM THAT ‘S/HE HE DID NOT KNOW ABOUT PLAGIARISM’. 4 CORRESPONDINGLY THEREFORE, TEACHERS AND INSTITUTIONS HAVE TO BE CLEAR THEMSELVES THAT THEY HAVE ENSURED THAT STUDENTS HAVE RECEIVED APPROPRIATE OPPORTUNITIES TO  UNDERSTAND ACADEMIC MISCONDUCT AND TO HAVE LEARNT THE NECESSARY SKILLS TO BEHAVE WITH ACADEMIC HONESTY. BELOW ARE SOME EXAMPLES OF PLAGIARISM: EMMA WAS DOING A LAW DEGREE AND FOUND THAT HER FLAT-MATE HAD DONE THE SAME MODULE THE YEAR BEFORE AND WAS WILLING TO LET EMMA LOOK AT HER ESSAYS – BUT INSISTED THAT SHE SHOULD NOT COPY ANY OF IT. EMMA COPIED A LARGE CHUNK OF ONE OF THEM BECAUSE SHE DID NOT UNDERSTAND THE SUBJECT AND ALTERED A FEW WORDS HERE AND THERE. UNFORTUNATELY FOR HER, SHE DID NOT NOTICE THE FONT WAS DIFFERENT ON THE COPIED CHUNK AND HER PLAGIARISM WAS DETECTED. ANNA HAD WORK TO DO IN CHEMISTRY THAT SHE DID NOT UNDERSTAND. IT WAS ABOUT THE NATURE OF A PARTICULAR REACTION. SHE LOOKED ON THE INTERNET AND FOUND A PIECE OF WRITING THAT WAS EXACTLY WHAT SHE NEEDED – AND CUT AND PASTED IT, ADDING A FEW WORDS OF INTRODUCTION AND CONCLUSION. ANTONIO PHONED HOME TO HIS FRIEND FOR HELP WITH AN ASSIGNMENT IN CIVIL ENGINEERING. HIS FRIEND FOUND A PIECE OF WRITING IN SPANISH. ANTONIO HAD IT TRANSLATED FROM THE ORIGINAL AND SUBMITTED THAT. BILLIE FOUND THAT AN OLD TEXTBOOK ON MODERN HISTORY AT HIS HOME THAT SAID EXACTLY WHAT HE NEEDED TO SAY IN AN ESSAY. HE COPIED IT. THE CHANGE IN STYLE WAS NOTICED BY HIS TUTOR, WHO CHALLENGED HIM. COLLUSION IS A FORM OF PLAGIARISM TOO. SOME EXAMPLES OF COLLUSION ARE: JOANNE WAS STRUGGLING IN HER EDUCATION DEGREE. HER FRIEND WAS DOING A SIMILAR DEGREE AT ANOTHER UNIVERSITY. THEY DECIDED TO CHOOSE THE SAME TOPIC FOR THEIR DISSERTATION AND TO WORK TOGETHER ON IT ASSUMING THAT THEY WOULD NOT BE FOUND OUT BECAUSE THEIR RESPECTIVE DISSERTATIONS WOULD NEVER BE SEEN TOGETHER. STUDENTS IN BUSINESS STUDIES WERE ASKED TO DEVELOP MARKETING STRATEGIES FOR A GIVEN PRODUCT. THEY WERE TOLD THAT THEY SHOULD WORK TOGETHER TO DO THE NECESSARY RESEARCH AND TO DEVELOP A PRESENTATION, BUT THAT THEY SHOULD THEN WORK ALONE IN THE PREPARATION OF THE WRITTEN WORK THAT THEY WOULD HAND IN. KAY WAS IN ONE OF THE GROUPS. SHE HAD NOT DONE HER FAIR SHARE OF THE INITIAL RESEARCH, AND WHEN IT CAME TO THE WRITTEN WORK SHE ASKED ONE OF HER GROUP TO HELP HER. THE COLLEAGUE LEANT KAY HIS COMPLETED WRITTEN WORK, AND SHE COPIED IT, THEN WROTE HER ACCOUNT, VERY HEAVILY BASED ON HIS. SHE SHOWED HIM HER VERY SIMILAR ACCOUNT BEFORE SHE HANDED IT IN – AND THANKED HIM BEFORE HE COULD OBJECT. BOTH OF THEM WERE DEEMED TO HAVE COLLUDED. 5 THE DEFINITION OF COLLUSION STARTS THE SAME AS FOR PLAGIARISM. COLLUSION IS THE  PASSING OFF OF ANOTHER’S WORK AS ONE’S OWN FOR ONE’S OWN BENEFIT AND IN ORDER TO DECEIVE ANOTHER. HOWEVER, IT GOES ON TO SAY THAT WHILE IN THE USUAL DEFINITION OF PLAGIARISM, THE OWNER OF THE WORK DOES NOT KNOWINGLY ALLOW THE USE OF HER WORK, IN A CASE OF COLLUSION, THE OWNER OF THE WORK KNOWS OF ITS USE AND WORKS WITH THE OTHER TOWARDS DECEPTION OF A THIRD PARTY. ON OCCASIONS, TWO PEOPLE MIGHT COLLUDE IN PLAGIARISING ANOTHER PIECE OF WORK. WHEN WE DEFINE COLLUSION, WE NEED TO BE CLEAR WHERE THE BOUNDARIES OF UNACCEPTABLE AND ACCEPTABLE CO-OPERATIVE OR COLLABORATIVE WORK ARE. CO-OPERATION IS SEEN AS OPENLY WORKING WITH ANOTHER OR OTHERS FOR MUTUAL BENEFIT WITH NO DECEPTION OF THE OTHER(S) INVOLVED. CO-OPERATIVE BEHAVIOUR IS A COMMON AND IS USUALLY WELCOMED PRACTICE IN HIGHER EDUCATION. RESEARCH TEAMS RELY ON IT. OFTEN YOU WILL BE TOLD THAT YOU SHOULD WORK TOGETHER TO THE POINT OF WRITING UP AN ASSIGNMENT, AND THEN WRITE IT UP SEPARATELY. HOWEVER, THERE MAY BE LOCAL ‘RULES’ OR DESIGNATIONS OF ACCEPTABLE PRACTICE AND OCCASIONALLY VOCABULARY USE WITH REGARD TO COLLUSION, COOPERATION AND COLLABORATION MAY VARY. IT IS IMPORTANT TO FIND OUT FROM YOUR TUTORS JUST WHAT IS  EXPECTED IN YOUR LOCAL CONTEXT. WHAT IS ACCEPTABLE MAY DIFFER FROM ASSIGNMENT TO ASSIGNMENT. IT IS POSSIBLE THAT ON OCCASIONS YOU WILL BE ASKED TO WORK JOINTLY ON A PIECE OF WRITING – AND CLEARLY, THAT IS ALL RIGHT. RATHER THAN TALKING IN THE NEGATIVE ABOUT THE AVOIDANCE OF COLLUSION OR PLAGIARISM, IT IS USEFUL TO USE THE IDEA OF WORKING WITH ACADEMIC HONESTY. ACADEMIC HONESTY IS WHERE YOU UNDERSTAND ACADEMIC CONVENTIONS AND WORK WITHIN THEM. IN THIS INDEPENDENT STUDY UNIT, WE PUT THE STRESS ON PLAGIARISM. THIS IS BECAUSE PLAGIARISM TAKES MORE EFFORT IN UNDERSTANDING THAN OTHER FORMS OF ACADEMIC MISCONDUCT. THIS IS NOT BECAUSE PLAGIARISM IS NECESSARILY MORE SERIOUS. THE FABRICATION OF DATA – OR MAKING UP OF EXPERIMENTAL RESULTS CAN BE FAR MORE SERIOUS AND HAVE FAR GREATER CONSEQUENCES THAN PLAGIARISM. SO THAT YOU CAN RETURN TO THIS MATERIAL EASILY ON FUTURE OCCASIONS, WE GATHER UP THESE IDEAS AS A SERIES OF DEFINITIONS AND PUT THEM INTO A GLOSSARY IN APPENDIX 1 OF THIS UNIT. Exercise 1: Thinking that you know about plagiarism does not mean that you can always decide what is right YOU HAVE NOW LOOKED AT THE EXPLANATIONS OF ACADEMIC HONESTY AND MISCONDUCT AND HAVE READ ABOUT THE JUSTIFICATION FOR CITATION. IT IS TIME TO TEST YOUR UNDERSTANDING. YOU WILL FIND, IN THE NEXT EXERCISE, THAT THINKING THAT YOU KNOW WHAT PLAGIARISM IS MAY NOT MEAN THAT YOU ACTUALLY KNOW WHAT IT IS WHEN IT COMES TO THE DISTINCTIONS OF RIGHT AND WRONG IN YOUR WORK OR THE WORK OF ANOTHER. SOME 6 OF THE EXAMPLES ARE PLAGIARISM, SOME ARE COLLUSION, SOME ARE CHEATING AND SOME ARE ALL RIGHT. REMEMBER THAT PLAGIARISM OCCURS WHEN THE WORK OF SOMEONE ELSE IS PRESENTED AS ONE’S OWN AND IS NOT ATTRIBUTED TO THE OTHER. ONE OF THE THREE ANSWERS GIVEN (A, B AND C) IS CLOSEST TO THE ANSWER. THE ANSWERS ARE AT THE END OF THE UNIT. 1. JOE HAS AN ESSAY TO PREPARE. HE METICULOUSLY READS BOOKS IN THE LIBRARY, BUT IS NOT SURE FROM WHICH TEXT THE IDEAS HAVE COME, AND WHICH IDEAS WERE HIS OWN. HE LISTS THE RANGE OF BOOKS HE THINKS HE USED IN HIS REFERENCE LIST. a) Not plagiarism but he should have cited the books in the text b) Plagiarism – he should have cited the books in the text c) Not a problem – he cited the books in the reference list 2. JAYNE DOES NOT KNOW HOW TO GET STARTED WITH AN ESSAY – SHE IS IN HER FIRST SEMESTER. SHE DELAYS STARTING IT AND THEN PANICS AND HER FRIEND SHOWS HER HOW SHE CAN BUY AN ESSAY FROM A PAPER MILL WEBSITE. SHE BUYS ONE AND SUBMITS IT (‘ONLY THIS TIME’ SHE SAYS). a) This is not all right but it is cheating, not plagiarism b) Plagiarism – and it is not all right c) Plagiarism but it is all right at this stage, but not later in the programme 3. TERRY AND FRAN LIVE IN THE SAME HOUSE. THEY ARE ON THE SAME COURSE AND HENCE HAVE TO PUT IN THE SAME ASSIGNMENTS. FRAN HAS DIFFICULTIES WITH WRITING BUT SHE REALLY WANTS TO DO WELL IN HER DEGREE. TERRY WOULD LIKE TO GET TO KNOW FRAN BETTER AND SEES THIS AS A WAY OF INCREASING THEIR FRIENDSHIP. HE SUGGESTS THAT SINCE THE CLASS IS LARGE, THEY COULD PUT IN THE SAME ESSAY AND NO-ONE  WOULD NOTICE – AND IN THIS WAY HE ‘HELPS’ OUT FRAN, WHO IS VERY GRATEFUL. a) Fran colluded. Terry did not. b) Terry colluded and Fran did not c) They colluded. 4. MIKE USES THE LIBRARY TO FIND THE RELEVANT LITERATURE TO THE ESSAY THAT HE HAS TO WRITE, THEN, USING ONE OF THE ESSAY SITES, BUYS A SIMILAR ESSAY AND INTEGRATES INTO IT THE MATERIAL THAT HE HAS READ. a) It is certain that Mike plagiarised b) Mike did not plagiarise if he cited the sources and paraphrased appropriately c) Mike has plagiarised because he bought the essay 5. MALACHY FOUND THAT HER FRIEND, WHO HAD DONE THE MODULE LAST YEAR, HAD DONE THE SAME EXPERIMENT. HER FRIEND SUGGESTED THAT MALACHY COULD READ THROUGH 7 WHAT SHE HAD WRITTEN BUT SHE WARNED HER NOT TO COPY IT AS THAT WOULD BE COLLUSION. WITHOUT HER FRIEND KNOWING, MALACHY DID COPY PART OF IT AND PRESENTED IT AS HER OWN. a) Malachy plagiarised her friend’s work b) Malachy and her friend colluded c) Malachy and her friend plagiarised 6. DAMION FINDS THAT AN ESSAY THAT HE HAS DONE IN SCHOOL IS VERY SIMILAR TO ONE HE HAS TO WRITE AT UNIVERSITY. HE USES HIS SCHOOL ESSAY – BUT UNFORTUNATELY HE DOES NOT HAVE THE REFERENCES PROPERLY RECORDED. HE HAS NAMES CITED IN THE TEXT, BUT NOT DETAILS OF THE SOURCES. HE MAKES UP ONE OR TWO AND THINKS THAT  HIS TUTOR WILL PROBABLY NOT WORRY ABOUT THE REST. a) Because it was school work – from a different place, it was all right b) It was all right because it had already been marked c) Damion plagiarised 7. SUE IS A LECTURER. SHE GIVES A LECTURE TO FIRST YEAR STUDENTS ON CELL BIOLOGY AND TALKS A LOT ABOUT CURRENT DEVELOPMENTS IN RESEARCH, BUT DOES NOT GIVE THE REFERENCES TO THE RESEARCH IN THE LECTURE OR ON HANDOUTS. a) Technically Sue plagiarised b) It is all right. If this had been written work, Sue should have cited correctly – but it was oral c) It is all right not to cite if your are a teacher / lecturer in the process of teaching. 8. TIM AND OONAGH ARE WORKING ON THE SAME ESSAY FOR THEOLOGY. OONAGH FINDS A GOOD WEBSITE THAT IS VERY HELPFUL. IT PROVIDES GOOD MATERIAL ON THE SUBJECT ON WHICH THEY ARE WRITING. SHE TELLS TIM ABOUT IT. THEY BOTH DOWNLOAD CHUNKS OF IT. OONAGH CUTS AND PASTES INTO HER ESSAY AND PUTS A REFERENCE TO THE SITE IN HER REFERENCE LIST. TIM PARAPHRASES FROM THE MATERIAL, ACKNOWLEDGES IT IN THE TEXT AND IN HIS REFERENCE LIST. THE TUTOR WOULD NOT HAVE NOTICED THE SIMILAR MATERIAL BUT FOR THE FACT THAT THE TWO ESSAYS WERE ADJACENT TO EACH OTHER IN THE PILE. a) Tim and Oonagh colluded b) Tim and Oonagh plagiarised. c) Only one of them plagiarised 9. IN STATISTICS, GEMMA HAS A PROJECT THAT INVOLVES USE OF A QUESTIONNAIRE TO FIND OUT WHAT TELEVISION PROGRAMMES HER FRIENDS WATCH AT A PARTICULAR TIME IN THE EVENING. THIS WILL GENERATE DATA FOR STATISTICAL ANALYSIS. SHE IS ILL FOR A FEW DAYS AND IS RUNNING LATE. SHE MAKES UP SOME OF THE RESPONSES AND USES THEM. a) Gemma plagiarised 8 b) Gemma cheated c) Gemma colluded 10. HARRY INTEGRATES INTO HIS ESSAY, A CHUNK OF HANDOUT MATERIAL FROM HIS LAST YEARS WORK. HE ALTERS SOME WORDS TO FIT BETTER AND SPLITS THE MATERIAL WITH TWO SECTIONS OF HIS OWN WRITING. a) Harry plagiarised. b) It is all right to quote from handout material without citation c) It would have been all right if Harry had rewritten it more in his own words 11. JAMIE HAS AN ESSAY TO WRITE IN PHILOSOPHY. HE IS NOT VERY GOOD AT WRITING AND HAS DEVELOPED A STYLE WHEREBY HE COPIES DOWN APPROPRIATE QUOTATIONS (CITING THEM APPROPRIATELY) AND THEN PARAPHRASES THE CONTENT OF THE QUOTATION IN THE NEXT PARAGRAPH AS A KIND OF SUMMARY, STEERING THE MEANING TOWARDS ANOTHER QUOTATION AND SO ON. a) So long as Jamie paraphrases appropriately, he is not doing anything wrong b) Jamie is plagiarising c) Jamie should be using appropriate methods of referencing 12. FOR SOPHIA, ENGLISH IS A SECOND LANGUAGE. SHE WANTS TO SUCCEED AND GOES TO A FRIEND WHO SPEAKS BETTER ENGLISH. HER FRIEND GOES THROUGH HER WHOLE ESSAY, CORRECTING THE LANGUAGE ALL THE WAY THROUGH. a) What Sophia is doing is understandable. It is all right b) What Sophia and her friend are doing is not all right. It is a form of collusion c) What Sophia is doing is not all right. It is cheating 13. BILLIE, ED AND JAKE LIVE ARE FOLLOWING THE SAME MODULE. THEY HAVE A PIECE OF WORK TO DO AND GET TOGETHER TO DISCUSS IT. THEY TALK ABOUT THE CONTENT AND DECIDE EACH TO FOLLOW UP TWO REFERENCES AND THEN TO MEET AGAIN TO TALK ABOUT. WHAT THEY HAVE FOUND. THIS REDUCES THE VOLUME OF READING THEY WILL HAVE TO DO. THEY MEET AGAIN, LISTEN TO EACH OTHER’S DESCRIPTIONS AND WRITE NOTES AND THEN WRITE THE ESSAY SEPARATELY. THEY REFERENCE THE MATERIAL, WHETHER IT IS WHAT THEY HAVE READ OR WHAT THEY HAVE HEARD DESCRIBED. a) Billie, Ed and Jake are colluding b) They are not doing anything wrong if co-operative study is acceptable to the tutor c) Billie, Ed and Jake are deceiving their tutor and therefore cheating 14. LUI FINDS SOME INFORMATION AT A WEBSITE THAT SAYS EXACTLY WHAT HE WANTS TO SAY. IT IS SIX LINES OF TEXT WHICH HE PUTS INTO QUOTATION MARKS. HE CUTS AND PASTES IT BUT BY MISTAKE LEAVES THE ORIGINAL FONT. HE CITES IT IN THE TEXT AND PUTS THE WEBSITE ADDRESS IN THE REFERENCE LIST WITH THE DATE OF ACCESS. HIS TUTOR CALLS HIM IN†¦ 9 a) Lui cheated b) He plagiarised c) What Lui did is all right. 15. CHARLIE KNOWS A REALLY GOOD WEBSITE THAT WILL HELP HIM A GREAT DEAL IN THE PROJECT WORK THAT HIS HAS BEEN SET. HE IS WORKING IN A TEAM, BUT THE WORK THAT THE TEAM DOES MUST BE WRITTEN UP SEPARATELY. INITIALLY HE MENTIONS THE WEBSITE, BUT GIVES NO ADDRESS – AND THEN REALISES THAT HE WOULD PREFER TO USE IT AS A REFERENCE FOR HIS INDIVIDUAL WORK. WHEN THE OTHERS ASK FOR DETAILS OF THE SITE, HE IS VAGUE AND THEN GIVES THE WRONG WEB ADDRESS TO THEM. a) Charlie is rightly not colluding with his team b) Charlie is not working co-operatively in his team c) Charlie is plagiarising – and it is just as well he did not pass on the information 16. AARON IS WRITING UP A REPORT. HE FINDS A TEXT BOOK THAT IS NOT THE ONE USED IN CLASS AND USES IT TO GET MUCH OF THE INFORMATION THAT HE REQUIRES. HE REFERS TO THE WORK OF JONDA (1998) THAT IS DESCRIBED AND REFERENCED IN THE TEXTBOOK. ARON CITES JONDA IN THE TEXT AND THEN REFERENCES IT TO THE TEXT BOOK IN HIS LIST OF REFERENCES. a) Aaron is behaving with academic honesty, his citations are fine b) Aaron is technically plariarising – he should have cited the original source, not the textbook c) Aaron is colluding with the writer of the textbook 17. TOM FINDS A HELPFUL ARTICLE IN A JOURNAL. HE PHOTOCOPIES IT AND COPIES FROM IT INTO HIS ESSAY, ALTERNATING SENTENCES OF THE ARTICLE WITH HIS OWN WORDS, AND NEVER COPYING MORE THAN A LINE WITHOUT ADDING HIS OWN WORDS OR ALTERING WORDS FROM THE TEXT. HE CITES THE ARTICLE IN HIS BIBLIOGRAPHY, BUT NOT IN THE TEXT BECAUSE HE DOES NOT FEEL THAT HE MAKES A SUFFICIENTLY SPECIFIC REFERENCE TO IT. a) Tom is cheating. b) Tom is plagiarising c) Tom is writing a good essay. He has properly cited the reference in his bibliography 18. AMY OMITS TO ACKNOWLEDGE THE MATERIAL THAT SHE HAS QUOTED. IT WAS A MISTAKE. a) Amy made a mistake and because she is a first year that is all right b) Amy plagiarised. c) Amy did not plagiarise because not referencing was unintentional 10 Exercise 2: What reasons do students give for academic misconduct? THINK OF FIVE EXCUSES THAT STUDENTS MIGHT MAKE FOR PLAGIARISING, COLLUDING OR CHEATING. SOME EXCUSES ARE UNDERSTANDABLE BUT THEY ARE AGAINST THE ACADEMIC CONVENTIONS THAT WE MAINTAIN WITHIN AN ACADEMIC COMMUNITY. THERE IS A LIST OF POSSIBLE RESPONSES AT THE END OF THE UNIT – THOUGH YOU MAY HAVE THOUGH OF OTHERS. The further information and skills that you need for academic honesty WE HAVE SAID THAT YOU NEED SOME INFORMATION, A SET OF SKILLS AND ASSOCIATED GOOD HABITS FOR YOUR ACADEMIC WORK. WE HAVE DESCRIBED ABOVE THE BASICS OF WHAT YOU NEED TO KNOW ABOUT ACADEMIC MISCONDUCT, PLAGIARISM AND COLLUSION BUT BEFORE WE LOOK AT THE SKILLS AND GOOD HABITS, THERE IS MORE TO SAY ABOUT WHY WE REFERENCE MATERIAL (REMEMBER REFERENCING, ACKNOWLEDGEMENT AND CITATION MEAN THE SAME THING). Further reasons for referencing. WE SAID ABOVE THAT WHEN WE USE THE IDEA OF ANOTHER, WE REFERENCE IT AND INDICATE THE SOURCE OF IT. IN TERMS OF PLAGIARISM, THIS IS IN ORDER TO DEMONSTRATE THAT IT IS AN IDEA THAT WAS GENERATED BY ANOTHER PERSON – AND TO ACKNOWLEDGE THAT PERSON FOR THE IDEA. HOWEVER IT IS ALSO IMPORTANT TO REFERENCE AN IDEA IN ORDER TO SHOW ANOTHER PERSON HOW TO FIND THAT IDEA SHOULD S/HE WANT TO SEEK READ MORE OF IT. IN ACADEMIC WRITING, IN ORDER TO FURTHER YOUR OWN THINKING, IT IS USUAL TO FOLLOW UP REFERENCES THAT SOMEONE ELSE HAS GIVEN IN THEIR REFERENCE LIST. SEEKING AND FINDING INFORMATION BECOMES A KIND OF TRAIL. SO A SECOND REASON FOR REFERENCING IS TO ENABLE OTHERS TO FIND THE IDEAS FOR THEMSELVES IN ORDER TO SEEK MORE INFORMATION. THE THIRD REASON FOR REFERENCING IS SO THAT ANYONE READING YOUR WORK (SUCH AS A TUTOR) CAN SEE HOW YOUR THINKING HAS BEEN DEVELOPED. WHEN YOU DO ACADEMIC WRITING YOU WORK WITH YOUR OWN IDEAS AND THOSE OF OTHERS IN ORDER TO RESPOND TO THE TASK SET. IT IS NOT USUALLY JUST A MATTER OF ‘WRITE AS MUCH AS YOU CAN ABOUT†¦(SOMETHING)’ IN HIGHER EDUCATION, BUT THE QUESTION OR TASK WILL REQUIRE YOU TO ‘MANIPULATE’ WHAT YOU KNOW – TO EXPLAIN, TO COMPARE OR COMPARE AND CONTRAST AND SO ON. WHEN YOU USE THE IDEAS OF OTHERS, IT IS IMPORTANT FOR YOUR TUTOR TO BE ABLE TO SEE HOW MUCH YOU HAVE READ, WHAT YOU HAVE READ AND HOW YOU HAVE USED AND MANIPULATED THE IDEAS IN ORDER TO MEET THE TASK SET IN THE ASSIGNMENT. LOOKING AT A REFERENCE LIST FOR THIS PURPOSE IS A FORM OF EVALUATION 11 YOU MAY THINK THAT SUCH EVALUATION ONLY HAPPENS WHEN YOU ARE A STUDENT. THIS IS NOT THE CASE. ACADEMIC AND RESEARCH WRITING IN JOURNALS AND BOOKS IS ALSO SUBJECTED TO EVALUATION – THIS TIME BY PEERS. SUCH RESEARCH WRITING USUALLY DEVELOPS NEW KNOWLEDGE. ONE OF THE WAYS IN WHICH THIS NEW KNOWLEDGE CAN BE. JUDGED BY THOSE WHO MIGHT USE IT, IS BY LOOKING AT THE LIST OF REFERENCES TO SEE WHAT KIND OF IDEAS HAVE FORMED THE BASIS TO THE NEW KNOWLEDGE. SOMETIMES THIS ‘BASIS’ IS IN THE FORM OF WHAT WE WOULD CALL ‘EVIDENCE’. MANY ACADEMICS WILL TURN TO THE REFERENCE LIST AS SOON AS THEY ARE GIVEN SOMETHING TO READ – IN ORDER TO SEE WHAT WORK THIS IS BASED ON. What do you not have to reference? NOT ALL IDEAS ARE CONSIDERED TO BELONG TO OTHERS. MOST OF WHAT WE KNOW IS ‘COMMON KNOWLEDGE’. THIS IS KNOWLEDGE THAT IS IN ‘EVERYDAY’ USE, OR IS IN THE COMMON DOMAIN OR IT IS KNOWLEDGE ABOUT WHICH WE COULD SAY THAT MOST PEOPLE. AGREE. IT IS THE SORT OF KNOWLEDGE THAT IS FOUND IN REFERENCE BOOKS – IN ENCYCLOPEDIAS OR DICTIONARIES. WE DO NOT NEED TO REFERENCE COMMON KNOWLEDGE, THOUGH USUALLY, IF YOU DO TAKE A DEFINITION FROM A DICTIONARY, YOU WILL CITE ITS SOURCE SO THAT OTHERS CAN FIND IT. WE DO NOT NEED TO REFERENCE IDEAS THAT ARE GENUINELY OUR OWN EITHER. IF THE IDEA IS ONE GENERATED BY YOU, BUT THAT YOU HAVE DESCRIBED IN YOUR OWN WORK ELSEWHERE, THEN IT IS GOOD PRACTICE TO REFERENCE IT TO THE FIRST OCCASION ON WHICH IT HAS BEEN USED (IE TO YOUR OWN NAME). THIS MAY BE MAINLY SO THAT OTHERS CAN FIND IT FOR INFORMATION PURPOSES. THE RULES ABOUT CITATION OF LECTURE AND HANDOUT MATERIAL ARE MORE FUZZY – TECHNICALLY YOU SHOULD SAY WHERE YOU HEARD ABOUT AN IDEA AS MUCH AS WHERE YOU READ ABOUT IT. HOWEVER, SOMETIMES THAT WOULD GET RIDICULOUS. IMAGINE HOW YOU WOULD MANAGE A QUESTION IN AN EXAM THAT ASKS YOU TO DESCRIBE SOMETHING THAT HAS BEEN DESCRIBED IN THE LECTURE. IT COULD BECOME VERY DIFFICULT. YOU NEED TO ASK YOUR LECTURERS AND TUTORS WHAT PRACTICE TO FOLLOW HERE. THEY MAY FEEL THAT YOU DO NOT NEED TO CITE LECTURES, BUT THAT YOU SHOULD CITE HANDOUT MATERIAL – AND THEY MAY NOT ALL AGREE ON THE SAME RESPONSE. IN ALL OF THIS YOU MAY NOT ALWAYS BE SURE WHETHER OR NOT TO CITE. A RULE BY WHICH TO WORK IS – IF IN DOUBT, CITE! SO – TO SUMMARISE: THERE ARE AT LEAST THREE REASONS WHY WE REFERENCE MATERIAL – -TO DEMONSTRATE THAT WE HAVE USED ANOTHER’S IDEA; -TO SHOW ANOTHER WHERE TO FIND THE SOURCE OF THE IDEAS USED; -TO ALLOW ANOTHER TO EVALUATE THE QUALITY OF OUR REASONING. The skills that you need 12 IN TERMS OF SKILLS, – YOU NEED TO BE ABLE TO: -DIFFERENTIATE MATERIAL THAT NEEDS CITATION FROM THAT THAT DOES NOT NEED CITATION; -USE IN-TEXT REFERENCING; -WRITE AN APPROPRIATE REFERENCE LIST AND UNDERSTAND THE DIFFERENCE. BETWEEN THIS AND A BIBLIOGRAPHY; -DEVELOP GOOD HABITS OF RECORD-KEEPING; -WORK APPROPRIATELY WITH QUOTATIONS; -MANAGE THE PRESENTATION OF OTHERS’ IDEAS IN WRITTEN WORK. (THE LIST IS MODIFIED FROM CARROLL, 2002) The ability to differentiate material that needs attribution from that that does not need attribution; YOU NEED TO KNOW AND TO BE ABLE TO DISTINGUISH BETWEEN WHAT DOES AND DOES NOT REQUIRE CITATION – THE FOLLOWING DO NOT NEED TO BE CITED: -COMMON KNOWLEDGE – WHICH WE HAVE DEFINED AS THAT IN EVERYDAY USE, IN THE COMMON DOMAIN; -FACTS THAT ARE GENERALLY AGREED, OR THAT ARE COMMON TO A VARIETY OF SOURCES; -PERSONAL IDEAS, SUGGESTIONS ETC. THE FOLLOWING NEED TO BE CITED: -DIRECT QUOTATIONS; -REFERENCES TO OTHERS’ IDEAS EXPRESSED ORALLY OR ON PAPER OR WEB-BASED MATERIALS ETC; -REFERENCES TO A REFERENCE ALREADY CITED BY ANOTHER IN A TEXT; -PARAPHRASES, PRECIS AND SUMMARIES OF OTHERS’ QUOTATIONS OR IDEAS; -OTHERS’ STATISTICS, FIGURES, CHARTS, TABLES, PICTURES GRAPHS ETC; -REFERENCES TO MATERIAL WITHIN AN EDITED TEXT. CLEARLY IT REQUIRES JUDGEMENT TO DECIDE WHAT DOES AND DOES NOT NEED TO BE CITED – AND IF IN DOUBT, CITE! Use of in-text referencing THIS IS A MATTER OF UNDERSTANDING HOW TO CITE IN TEXT AND HOW TO CONSTRUCT A  REFERENCE LIST. THERE ARE DIFFERENT CONVENTIONS, AND SOMETIMES THERE ARE VARIABLE INTERPRETATIONS OF THE CONVENTION ADOPTED. SOME USE REFERENCE LISTS AT THE END OF THE TEXT, SOME WORK WITH FOOTNOTES OR ENDNOTES THAT ARE LINKED FROM THE TEXT BY NUMBER OR LETTER. 13 E. G. (1) OR (A). IN THESE CASES, THE DETAILS OF NAME, DATE AND SOURCE ARE EITHER AT THE BOTTOM OF THE PAGE OR LISTED BY NUMBER OR LETTER SEQUENCE AT THE END OF THE ARTICLE OR BOOK. REFERENCES MAY BE MIXED WITH NOTES. HARVARD IS A VERY COMMON SYSTEM IN HIGHER EDUCATION INSTITUTIONS. E. G. †¦IN THE HARVARD SYSTEM – THE NAME AND DATE IS PUT IN THE TEXT (E. G.DIPPIDY, 1999) AND IN THE REFERENCE LIST AT THE END OF THE ARTICLE OR THE BOOK, THE REFERENCES ARE LISTED ALPHABETICALLY WITH THE FURTHER DETAILS OF SOURCE. DIFFERENT DISCIPLINES TEND TO ADOPT DIFFERENT CONVENTIONS, AND ACADEMIC JOURNALS AND PUBLISHERS OFTEN DIFFER IN THE CONVENTIONS ADOPTED, SO YOU WILL COME ACROSS DIFFERENT STYLES IN YOUR READING. USUALLY IN UNDERGRADUATE STUDIES, YOU WILL BE TOLD TO WORK TO A PARTICULAR CONVENTION BUT YOU MAY NEED TO LEARN TO BE MORE FLEXIBLE. IT IS NOT WORTH REBELLING IN THIS MATTER. THERE ARE USUALLY HANDOUTS OR BOOKLETS THAT PROVIDE ILLUSTRATION OF THIS. IF YOU DO NOT KNOW WHAT SYSTEM OF REFERENCING TO  USE, ASK. MAKE SURE THAT WITHIN THE SYSTEM YOU USE, YOU KNOW HOW TO DEAL WITH THE FOLLOWING: – QUOTATIONS (SEE BELOW ALSO); – DIRECT REFERENCES TO WRITTEN AND SPOKEN WORD; – REFERENCES CITED WITHIN ANOTHER TEXT – TO WHICH YOU WANT TO REFER; – PARAPHRASES OR SUMMARIES OF OTHERS’ IDEAS; – THE CITATION OF STATISTICS AND FIGURATIVE MATERIAL; – REFERENCES WITHIN EDITED TEXTS, WEB-BASED MATERIALS, CD-ROMS. THERE MAY BE OTHER SOURCES THAT YOU WANT TO CITE. YOU DO NOT NEED TO KNOW ALL THIS ‘BY HEART’, BUT HAVE ACCESS TO A GOOD GUIDE TO REFERENCING AS YOU WORK AND MAKE SURE THAT IT USES THE APPROPRIATE STYLE. IF YOUR FEEL THAT YOUR GUIDE-BOOK IS  NOT HELPFUL, LOOK AT STUDY SKILLS BOOKS OR LOOK ON THE WEB FOR THE SYSTEM YOU NEED. THE AMERICAN UNIVERSITIES OFTEN HAVE USEFUL MATERIAL The layout of a reference list and its distinction from a bibliography A REFERENCE LIST IS A LIST OF THE REFERENCES TO WHICH YOU HAVE REFERRED IN YOUR TEXT. A BIBLIOGRAPHY IS A REFERENCE LIST TO WHICH IS ADDED ANY EXTRA MATERIAL THAT MIGHT PROVIDE GENERAL OR FURTHER INFORMATION ABOUT THE TOPIC. IN ACADEMIC WORK, MOSTLY IT WILL BE REFERENCE LISTS WITH WHICH YOU WORK.

Tuesday, July 30, 2019

Sage 50 Accounting Software Tutorial

Sage Tutorial Release 5. 3 The Sage Development Team September 10, 2012 CONTENTS 1 Introduction 1. 1 Installation 1. 2 Ways to Use Sage . . 1. 3 Longterm Goals for Sage . . 3 4 4 4 7 7 9 10 13 18 21 24 26 29 33 38 39 41 51 51 53 54 54 55 56 57 58 60 61 62 65 65 66 67 68 2 A Guided Tour 2. 1 Assignment, Equality, and Arithmetic 2. Getting Help . 2. 3 Functions, Indentation, and Counting 2. 4 Basic Algebra and Calculus . . 2. 5 Plotting . 2. 6 Some Common Issues with Functions 2. 7 Basic Rings . . 2. 8 Linear Algebra 2. 9 Polynomials . 2. 10 Parents, Conversion and Coercion . . 2. 11 Finite Groups, Abelian Groups . 2. 12 Number Theory . . 2. 13 Some More Advanced Mathematics 3 The Interactive Shell 3. 1 Your Sage Session . . 3. 2 Logging Input and Output . 3. 3 Paste Ignores Prompts 3. 4 Timing Commands . . 3. 5 Other IPython tricks . 3. 6 Errors and Exceptions 3. 7 Reverse Search and Tab Completion . . 3. 8 Integrated Help System . 3. 9 Saving and Loading Individual Objects 3. 10 Savi ng and Loading Complete Sessions 3. 11 The Notebook Interface . . 4 Interfaces 4. 1 GP/PARI 4. 2 GAP . . 4. 3 Singular . 4. 4 Maxima i 5 Sage, LaTeX and Friends 5. 1 Overview . . 5. 2 Basic Use . . 5. 3 Customizing LaTeX Generation . . 5. 4 Customizing LaTeX Processing . . 5. 5 An Example: Combinatorial Graphs with tkz-graph . 5. 6 A Fully Capable TeX Installation . 5. 7 External Programs . 71 71 72 73 75 76 77 77 79 79 80 81 81 82 84 85 86 86 88 91 93 93 94 95 97 97 99 101 103 105 6 Programming 6. 1 Loading and Attaching Sage ? les 6. 2 Creating Compiled Code . 6. 3 Standalone Python/Sage Scripts . 6. 4 Data Types 6. 5 Lists, Tuples, and Sequences 6. 6 Dictionaries 6. 7 Sets . 6. 8 Iterators . . 6. 9 Loops, Functions, Control Statements, and Comparisons 6. 10 Pro? ling . 7 Using SageTeX 8 . . Afterword 8. 1 Why Python? . . 8. I would like to contribute somehow. How can I? . 8. 3 How do I reference Sage? . 9 Appendix 9. 1 Arithmetical binary operator precedence . . 10 Bibliography 1 1 Indices and tables Bibliography Index ii Sage Tutorial, Release 5. 3 Sage is free, open-source math software that supports research and teaching in algebra, geometry, number theory, cryptography, numerical computation, and related areas. Both the Sage development model and the technology in Sage itself are distinguished by an extremely strong emphasis on openness, community, cooperation, and collaboration: we are building the car, not reinventing the wheel. The overall goal of Sage is to create a viable, free, open-source alternative to Maple, Mathematica, Magma, and MATLAB. This tutorial is the best way to become familiar with Sage in only a few hours. You can read it in HTML or PDF versions, or from the Sage notebook (click Help, then click Tutorial to interactively work through the tutorial from within Sage). This work is licensed under a Creative Commons Attribution-Share Alike 3. 0 License. CONTENTS 1 Sage Tutorial, Release 5. 3 2 CONTENTS CHAPTER ONE INTRODUCTION This tutorial should take at most 3-4 hours to fully work through. You can read it in HTML or PDF versions, or from the Sage notebook click Help, then click Tutorial to interactively work through the tutorial from within Sage. Though much of Sage is implemented using Python, no Python background is needed to read this tutorial. You will want to learn Python (a very fun language! ) at some point, and there are many excellent free resources for doing so including [PyT] and [Dive]. If you just want to quickly try out Sage, this tutorial is the place to start. For example: sage: 2 + 2 4 sage: factor(-2007) -1 * 3^2 * 223 sage: A = matrix(4,4, range(16)); A [ 0 1 2 3] [ 4 5 6 7] [ 8 9 10 11] [12 13 14 15] sage: factor(A. charpoly()) x^2 * (x^2 – 30*x – 80) sage: m = matrix(ZZ,2, range(4)) sage: m[0,0] = m[0,0] – 3 sage: m [-3 1] [ 2 3] sage: E = EllipticCurve([1,2,3,4,5]); sage: E Elliptic Curve defined by y^2 + x*y + 3*y = x^3 + 2*x^2 + 4*x + 5 over Rational Field sage: E. anlist(10) [0, 1, 1, 0, -1, -3, 0, -1, -3, -3, -3] sage: E. ank() 1 sage: k = 1/(sqrt(3)*I + 3/4 + sqrt(73)*5/9); k 1/(I*sqrt(3) + 5/9*sqrt(73) + 3/4) sage: N(k) 0. 165495678130644 – 0. 0521492082074256*I sage: N(k,30) # 30 â€Å"bits† 0. 16549568 – 0. 052149208*I sage: latex(k) frac{1}{i , sqrt{3} + frac{5}{9} , sqrt{73} + frac{3}{4}} 3 Sage Tutorial, Release 5. 3 1. 1 Installation If you do not have Sage installed on a computer and just want to try s ome commands, use online at http://www. sagenb. org. See the Sage Installation Guide in the documentation section of the main Sage webpage [SA] for instructions on installing Sage on your computer. Here we merely make a few comments. 1. The Sage download ? le comes with â€Å"batteries included†. In other words, although Sage uses Python, IPython, PARI, GAP, Singular, Maxima, NTL, GMP, and so on, you do not need to install them separately as they are included with the Sage distribution. However, to use certain Sage features, e. g. , Macaulay or KASH, you must install the relevant optional package or at least have the relevant programs installed on your computer already. Macaulay and KASH are Sage packages (for a list of available optional packages, type sage -optional, or browse the â€Å"Download† page on the Sage website). . The pre-compiled binary version of Sage (found on the Sage web site) may be easier and quicker to install than the source code version. Just unpack the ? le and run sage. 3. If you’d like to use the SageTeX package (which allows you to embed the results of Sage computations into a LaTeX ? le), you will need to make SageTeX known to yo ur TeX distribution. To do this, see the section â€Å"Make SageTeX known to TeX† in the Sage installation guide (this link should take you to a local copy of the installation guide). It’s quite easy; you just need to set an environment variable or copy a single ? e to a directory that TeX will search. The documentation for using SageTeX is located in $SAGE_ROOT/local/share/texmf/tex/generic/sagetex/, where â€Å"$SAGE_ROOT† refers to the directory where you installed Sage – for example, /opt/sage-4. 2. 1. 1. 2 Ways to Use Sage You can use Sage in several ways. †¢ Notebook graphical interface: see the section on the Notebook in the reference manual and The Notebook Interface below, †¢ Interactive command line: see The Interactive Shell, †¢ Programs: By writing interpreted and compiled programs in Sage (see Loading and Attaching Sage ? es and Creating Compiled Code), and †¢ Scripts: by writing stand-alone Python scripts that use the Sag e library (see Standalone Python/Sage Scripts). 1. 3 Longterm Goals for Sage †¢ Useful: Sage’s intended audience is mathematics students (from high school to graduate school), teachers, and research mathematicians. The aim is to provide software that can be used to explore and experiment with mathematical constructions in algebra, geometry, number theory, calculus, numerical computation, etc. Sage helps make it easier to interactively experiment with mathematical objects. Ef? cient: Be fast. Sage uses highly-optimized mature software like GMP, PARI, GAP, and NTL, and so is very fast at certain operations. †¢ Free and open source: The source code must be freely available and readable, so users can understand what the system is really doing and more easily extend it. Just as mathematicians gain a deeper understanding of a theorem by carefully reading or at least skimming the proof, people who do computations should be able to understand how the calculations work by re ading documented source code. If you use Sage to do computations 4 Chapter 1. Introduction Sage Tutorial, Release 5. 3 in a paper you publish, you can rest assured that your readers will always have free access to Sage and all its source code, and you are even allowed to archive and re-distribute the version of Sage you used. †¢ Easy to compile: Sage should be easy to compile from source for Linux, OS X and Windows users. This provides more ? exibility for users to modify the system. †¢ Cooperation: Provide robust interfaces to most other computer algebra systems, including PARI, GAP, Singular, Maxima, KASH, Magma, Maple, and Mathematica. Sage is meant to unify and extend existing math software. †¢ Well documented: Tutorial, programming guide, reference manual, and how-to, with numerous examples and discussion of background mathematics. †¢ Extensible: Be able to de? ne new data types or derive from built-in types, and use code written in a range of languages. †¢ User friendly: It should be easy to understand what functionality is provided for a given object and to view documentation and source code. Also attain a high level of user support. 1. 3. Longterm Goals for Sage 5 Sage Tutorial, Release 5. 3 6 Chapter 1. Introduction CHAPTER TWO A GUIDED TOUR This section is a guided tour of some of what is available in Sage. For many more examples, see â€Å"Sage Constructions†, which is intended to answer the general question â€Å"How do I construct ? †. See also the â€Å"Sage Reference Manual†, which has thousands more examples. Also note that you can interactively work through this tour in the Sage notebook by clicking the Help link. (If you are viewing the tutorial in the Sage notebook, press shift-enter to evaluate any input cell. You can even edit the input before pressing shift-enter. On some Macs you might have to press shift-return rather than shift-enter. ) 2. 1 Assignment, Equality, and Arithmetic With some minor exceptions, Sage uses the Python programming language, so most introductory books on Python will help you to learn Sage. Sage uses = for assignment. It uses ==, =, < and > for comparison: sage: sage: 5 sage: True sage: False sage: True sage: True a = 5 a 2 == 2 2 == 3 2 < 3 a == 5 Sage provides all of the basic mathematical operations: age: 8 sage: 8 sage: 1 sage: 5/2 sage: 2 sage: True 2**3 2^3 10 % 3 10/4 10//4 # for integer arguments, // returns the integer quotient # # # ** means exponent ^ is a synonym for ** (unlike in Python) for integer arguments, % means mod, i. e. , remainder 4 * (10 // 4) + 10 % 4 == 10 7 Sage Tutorial, Release 5. 3 sage: 3^2*4 + 2%5 38 The computation of an expression like 3^2*4 + 2%5 depends on the order in which the operations are applied; this is speci? ed in the â€Å"operator precedence table† in Arithmetical binary operator precedence. Sage also provides many familiar mathematical functions; here are just a few examples: sage: sqrt(3. ) 1. 84390889145858 sage: sin(5. 135) -0. 912021158525540 sage: sin(pi/3) 1/2*sqrt(3) As the last example shows, some mathematical expressions return ‘exact’ values, rather than numerical approximations. To get a numerical approximation, use either the function n or the method n (and both of these have a longer name, numerical_approx, and the function N is the same as n)). These take optional arguments prec, which is the requested number of bits of precision, and digits, which is the requested number of decimal digits of precision; the default is 53 bits of precision. sage: exp(2) e^2 sage: n(exp(2)) 7. 8905609893065 sage: sqrt(pi). numerical_approx() 1. 77245385090552 sage: sin(10). n(digits=5) -0. 54402 sage: N(sin(10),digits=10) -0. 5440211109 sage: numerical_approx(pi, prec=200) 3. 14 15926535897932384626433832795028841971693993751058209749 Python is dynamically typed, so the value referred to by each variable has a type associated with it, but a given variable may hold values of any Python type within a given scope: sage: sage: The C programming language, which is statically typed, is much different; a variable declared to hold an int can only hold an int in its scope. A potential source of confusion in Python is that an integer literal that begins with a zero is treated as an octal number, i. e. , a number in base 8. sage: 9 sage: 9 sage: sage: ’11’ 011 8 + 1 n = 011 n. str(8) # string representation of n in base 8 8 Chapter 2. A Guided Tour Sage Tutorial, Release 5. 3 This is consistent with the C programming language. 2. 2 Getting Help Sage has extensive built-in documentation, accessible by typing the name of a function or a constant (for example), followed by a question mark: sage: tan? Type: Definition: Docstring: tan( [noargspec] ) The tangent function EXAMPLES: sage: tan(pi) 0 sage: tan(3. 1415) -0. 0000926535900581913 sage: tan(3. 1415/4) 0. 999953674278156 sage: tan(pi/4) 1 sage: tan(1/2) tan(1/2) sage: RR(tan(1/2)) 0. 546302489843790 sage: log2? Type: Definition: log2( [noargspec] ) Docstring: The natural logarithm of the real number 2. EXAMPLES: sage: log2 log2 sage: float(log2) 0. 69314718055994529 sage: RR(log2) 0. 693147180559945 sage: R = RealField(200); R Real Field with 200 bits of precision sage: R(log2) 0. 9314718055994530941723212145817656807550013436025525412068 sage: l = (1-log2)/(1+log2); l (1 – log(2))/(log(2) + 1) sage: R(l) 0. 18123221829928249948761381864650311423330609774776013488056 sage: maxima(log2) log(2) sage: maxima(log2). float() . 6931471805599453 sage: gp(log2) 0. 6931471805599453094172321215 # 32-bit 0. 69314718055994530941723212145817656807 # 64-bit sage: sudoku? 2. 2. Getting Help 9 Sage Tutorial, Release 5. 3 File: Type: D efinition: Docstring: sage/local/lib/python2. 5/site-packages/sage/games/sudoku. py sudoku(A) Solve the 9Ãâ€"9 Sudoku puzzle defined by the matrix A. EXAMPLE: sage: A = matrix(ZZ,9,[5,0,0, 0,8,0, 0,4,9, 0,0,0, 5,0,0, 0,3,0, 0,6,7, 3,0,0, 0,0,1, 1,5,0, 0,0,0, 0,0,0, 0,0,0, 2,0,8, 0,0,0, 0,0,0, 0,0,0, 0,1,8, 7,0,0, 0,0,4, 1,5,0, 0,3,0, 0,0,2, 0,0,0, 4,9,0, 0,5,0, 0,0,3]) sage: A [5 0 0 0 8 0 0 4 9] [0 0 0 5 0 0 0 3 0] [0 6 7 3 0 0 0 0 1] [1 5 0 0 0 0 0 0 0] [0 0 0 2 0 8 0 0 0] [0 0 0 0 0 0 0 1 8] [7 0 0 0 0 4 1 5 0] [0 3 0 0 0 2 0 0 0] [4 9 0 0 5 0 0 0 3] sage: sudoku(A) [5 1 3 6 8 7 2 4 9] [8 4 9 5 2 1 6 3 7] [2 6 7 3 4 9 5 8 1] [1 5 8 4 6 3 9 7 2] [9 7 4 2 1 8 3 6 5] [3 2 6 7 9 5 4 1 8] [7 8 2 9 3 4 1 5 6] [6 3 5 1 7 2 8 9 4] [4 9 1 8 5 6 7 2 3] Sage also provides ‘Tab completion’: type the ? rst few letters of a function and then hit the tab key. For example, if you type ta followed by TAB, Sage will print tachyon, tan, tanh, taylor. This provides a good way to ? nd the names of functions and other structures in Sage. 2. 3 Functions, Indentation, and Counting To de? ne a new function in Sage, use the def command and a colon after the list of variable names. For example: sage: def is_even(n): return n%2 == 0 sage: is_even(2) True sage: is_even(3) False Note: Depending on which version of the tutorial you are viewing, you may see three dots n the second line of this example. Do not type them; they are just to emphasize that the code is indented. Whenever this is the case, press [Return/Enter] once at the end of the block to insert a blank line and conclude the function de? nition. You do not specify the types of any of the input arguments. You can specify multiple inputs, each of which may have an optional defaul t value. For example, the function below defaults to divisor=2 if divisor is not speci? ed. 10 Chapter 2. A Guided Tour Sage Tutorial, Release 5. 3 sage: sage: True sage: True sage: False ef is_divisible_by(number, divisor=2): return number%divisor == 0 is_divisible_by(6,2) is_divisible_by(6) is_divisible_by(6, 5) You can also explicitly specify one or either of the inputs when calling the function; if you specify the inputs explicitly, you can give them in any order: sage: is_divisible_by(6, divisor=5) False sage: is_divisible_by(divisor=2, number=6) True In Python, blocks of code are not indicated by curly braces or begin and end blocks as in many other languages. Instead, blocks of code are indicated by indentation, which must match up exactly. For example, the following is a syntax error because the return statement is not indented the same amount as the other lines above it. sage: def even(n): v = [] for i in range(3,n): if i % 2 == 0: v. append(i) return v Syntax Error: return v If you ? x the indentation, the function works: sage: def even(n): v = [] for i in range(3,n): if i % 2 == 0: v. append(i) return v sage: even(10) [4, 6, 8] Semicolons are not needed at the ends of lines; a line is in most cases ended by a newline. However, you can put multiple statements on one line, separated by semicolons: sage: a = 5; b = a + 3; c = b^2; c 64 If you would like a single line of code to span multiple lines, use a terminating backslash: sage: 2 + 3 5 In Sage, you count by iterating over a range of integers. For example, the ? rst line below is exactly like for(i=0; i x^2 sage: g(3) 9 sage: Dg = g. derivative(); Dg x |–> 2*x sage: Dg(3) 6 sage: type(g) sage: plot(g, 0, 2) Note that while g is a callable symbolic expression, g(x) is a related, but different sort of object, which can also be plotted, differentated, etc. , albeit with some issues: see item 5 below for an illustration. sage: x^2 sage: g(x). derivative() plot(g(x), 0, 2) 3. Use a pre-de? ed Sage ‘calculus function’. These can be plotted, and with a little help, differentiated, and integrated. sage: type(sin) sage: plot(sin, 0, 2) sage: type(sin(x)) sage: plot(sin(x), 0, 2) By itself, sin cannot be differentiated, at least not to produce cos. sage: f = sin sage: f. derivative() Traceback (most recent call last): AttributeError: Using f = sin(x) instead of sin works, but it is probably even better to use f(x) = sin(x) to de? ne a callable symbolic expression. sage: S(x) = sin(x) sage: S. derivative() x |–> cos(x) Here are some common problems, with explanations: 4. Accidental evaluation. sage: def h(x): f x 1 to 0. sage: G = DirichletGroup(12) sage: G. list() [Dirichlet character modulo 12 of conductor 1 mapping 7 |–> 1, 5 |–> 1, Dirichlet character modulo 12 of conductor 4 mapping 7 |–> -1, 5 |–> 1, Dirichlet character modulo 12 of conductor 3 mapping 7 |–> 1, 5 |–> -1, Dirichlet character modulo 12 of conductor 12 mapping 7 |–> -1, 5 |–> -1] sage: G. gens() (Dirichlet character modulo 12 of conductor 4 mapping 7 |–> -1, 5 |–> 1, Dirichlet character modulo 12 of conductor 3 mapping 7 |–> 1, 5 |–> -1) sage: len(G) 4 Having created the group, we next create an element and compute with it. age: G = DirichletGroup(21) sage: chi = G. 1; c hi Dirichlet character modulo 21 of conductor 7 mapping 8 |–> 1, 10 |–> zeta6 sage: chi. values() [0, 1, zeta6 – 1, 0, -zeta6, -zeta6 + 1, 0, 0, 1, 0, zeta6, -zeta6, 0, -1, 0, 0, zeta6 – 1, zeta6, 0, -zeta6 + 1, -1] sage: chi. conductor() 7 sage: chi. modulus() 21 sage: chi. order() 6 sage: chi(19) -zeta6 + 1 sage: chi(40) -zeta6 + 1 It is also possible to compute the action of the Galois group Gal(Q(? N )/Q) on these characters, as well as the direct product decomposition corresponding to the factorization of the modulus. sage: chi. alois_orbit() [Dirichlet character modulo 21 of conductor 7 mapping 8 |–> 1, 10 |–> zeta6, 2. 13. Some More Advanced Mathematics 45 Sage Tutorial, Release 5. 3 Dirichlet character modulo 21 of conductor 7 mapping 8 |–> 1, 10 |–> -zeta6 + 1] sage: go = G. galois_orbits() sage: [len(orbit) for orbit in go] [1, 2, 2, 1, 1, 2, 2, 1] sage: [ Group 6 and Group 6 and ] G. decomposition() of Dirichlet char acters of modulus 3 over Cyclotomic Field of order degree 2, of Dirichlet characters of modulus 7 over Cyclotomic Field of order degree 2 Next, we construct the group of Dirichlet characters mod 20, but with values n Q(i): sage: sage: sage: Group K. = NumberField(x^2+1) G = DirichletGroup(20,K) G of Dirichlet characters of modulus 20 over Number Field in i with defining polynomial x^2 + 1 We next compute several invariants of G: sage: G. gens() (Dirichlet character modulo 20 of conductor 4 mapping 11 |–> -1, 17 |–> 1, Dirichlet character modulo 20 of conductor 5 mapping 11 |–> 1, 17 |–> i) sage: G. unit_gens() [11, 17] sage: G. zeta() i sage: G. zeta_order() 4 In this example we create a Dirichlet character with values in a number ? eld. We explicitly specify the choice of root of unity by the third argument to DirichletGroup below. age: x = polygen(QQ, ’x’) sage: K = NumberField(x^4 + 1, ’a’); a = K. 0 sage: b = K. gen(); a == b True sage: K Number Field in a with defining polynomial x^4 + 1 sage: G = DirichletGroup(5, K, a); G Group of Dirichlet characters of modulus 5 over Number Field in a with defining polynomial x^4 + 1 sage: chi = G. 0; chi Dirichlet character modulo 5 of conductor 5 mapping 2 |–> a^2 sage: [(chi^i)(2) for i in range(4)] [1, a^2, -1, -a^2] Here NumberField(x^4 + 1, ’a’) tells Sage to use the symbol â€Å"a† in printing what K is (a Number Field in a with de? ning polynomial x4 + 1). The name â€Å"a† is undeclared at this point. Once a = K. 0 (or equivalently a = K. gen()) is evaluated, the symbol â€Å"a† represents a root of the generating polynomial x4 + 1. 46 Chapter 2. A Guided Tour Sage Tutorial, Release 5. 3 2. 13. 4 Modular Forms Sage can do some computations related to modular forms, including dimensions, computing spaces of modular symbols, Hecke operators, and decompositions. There are several functions available for computing dimensions of spaces of modular forms. For example, sage: dimension_cusp_forms(Gamma0(11),2) 1 sage: dimension_cusp_forms(Gamma0(1),12) 1 sage: dimension_cusp_forms(Gamma1(389),2) 6112 Next we illustrate computation of Hecke operators on a space of modular symbols of level 1 and weight 12. sage: M = ModularSymbols(1,12) sage: M. basis() ([X^8*Y^2,(0,0)], [X^9*Y,(0,0)], [X^10,(0,0)]) sage: t2 = M. T(2) sage: t2 Hecke operator T_2 on Modular Symbols space of dimension 3 for Gamma_0(1) of weight 12 with sign 0 over Rational Field sage: t2. matrix() [ -24 0 0] [ 0 -24 0] [4860 0 2049] sage: f = t2. charpoly(’x’); f x^3 – 2001*x^2 – 97776*x – 1180224 sage: factor(f) (x – 2049) * (x + 24)^2 sage: M. T(11). charpoly(’x’). factor() (x – 285311670612) * (x – 534612)^2 We can also create spaces for ? 0 (N ) and ? 1 (N ). sage: ModularSymbols(11,2) Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field sage: ModularSymbols(Gamma1(11),2) Modular Symbols space of dimension 11 for Gamma_1(11) of weight 2 with sign 0 and over Rational Field Let’s compute some characteristic polynomials and q-expansions. sage: M = ModularSymbols(Gamma1(11),2) sage: M. T(2). charpoly(’x’) x^11 – 8*x^10 + 20*x^9 + 10*x^8 – 145*x^7 + 229*x^6 + 58*x^5 – 360*x^4 + 70*x^3 – 515*x^2 + 1804*x – 1452 sage: M. T(2). charpoly(’x’). actor() (x – 3) * (x + 2)^2 * (x^4 – 7*x^3 + 19*x^2 – 23*x + 11) * (x^4 – 2*x^3 + 4*x^2 + 2*x + 11) sage: S = M. cuspidal_submodule() sage: S. T(2). matrix() [-2 0] [ 0 -2] sage: S. q_expansion_basis(10) [ q – 2*q^2 – q^3 + 2*q^4 + q^5 + 2*q^6 – 2*q^7 – 2*q^9 + O(q^10) ] 2. 13. Some More A dvanced Mathematics 47 Sage Tutorial, Release 5. 3 We can even compute spaces of modular symbols with character. sage: G = DirichletGroup(13) sage: e = G. 0^2 sage: M = ModularSymbols(e,2); M Modular Symbols space of dimension 4 and level 13, weight 2, character [zeta6], sign 0, over Cyclotomic Field of order 6 and degree 2 sage: M. T(2). charpoly(’x’). factor() (x – 2*zeta6 – 1) * (x – zeta6 – 2) * (x + zeta6 + 1)^2 sage: S = M. cuspidal_submodule(); S Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 4 and level 13, weight 2, character [zeta6], sign 0, over Cyclotomic Field of order 6 and degree 2 sage: S. T(2). charpoly(’x’). factor() (x + zeta6 + 1)^2 sage: S. q_expansion_basis(10) [ q + (-zeta6 – 1)*q^2 + (2*zeta6 – 2)*q^3 + zeta6*q^4 + (-2*zeta6 + 1)*q^5 + (-2*zeta6 + 4)*q^6 + (2*zeta6 – 1)*q^8 – zeta6*q^9 + O(q^10) ] Here is another example of how Sage can compute the action of Hecke operators on a space of modular forms. sage: T = ModularForms(Gamma0(11),2) sage: T Modular Forms space of dimension 2 for Congruence Subgroup Gamma0(11) of weight 2 over Rational Field sage: T. degree() 2 sage: T. level() 11 sage: T. group() Congruence Subgroup Gamma0(11) sage: T. dimension() 2 sage: T. cuspidal_subspace() Cuspidal subspace of dimension 1 of Modular Forms space of dimension 2 for Congruence Subgroup Gamma0(11) of weight 2 over Rational Field sage: T. isenstein_subspace() Eisenstein subspace of dimension 1 of Modular Forms space of dimension 2 for Congruence Subgroup Gamma0(11) of weight 2 over Rational Field sage: M = ModularSymbols(11); M Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field sage: M. weight() 2 sage: M. basis() ((1,0), (1,8), (1,9)) sage: M. sign() 0 Let Tp denote the usual Hecke operators (p prime). How do the Hecke operators T2 , T3 , T5 act on the space of modular symbols? sage: M. T(2). matrix() [ 3 0 -1] [ 0 -2 0] [ 0 0 -2] sage: M. T(3). matrix() [ 4 0 -1] 8 Chapter 2. A Guided Tour Sage Tutorial, Release 5. 3 [ 0 -1 0] [ 0 0 -1] sage: M. T(5). matrix() [ 6 0 -1] [ 0 1 0] [ 0 0 1] 2. 13. Some More Advanced Mathematics 49 Sage Tutorial, Release 5. 3 50 Chapter 2. A Guided Tour CHAPTER THREE THE INTERACTIVE SHELL In most of this tutorial, we assume you start the Sage interpreter using the sage command. This starts a customized version of the IPython shell, and imports many functions and classes, so they are ready to use from the command prompt. Further customization is possible by editing the $SAGE_ROOT/ipythonrc ? le. Upon starting Sage, you get output similar to the following: ———————————————————————| SAGE Version 3. 1. 1, Release Date: 2008-05-24 | | Type notebook() for the GUI, and license() for information. | ———————————————————————- sage: To quit Sage either press Ctrl-D or type quit or exit. sage: quit Exiting SAGE (CPU time 0m0. 00s, Wall time 0m0. 89s) The wall time is the time that elapsed on the clock hanging from your wall. This is relevant, since CPU time does not track time used by subprocesses like GAP or Singular. Avoid killing a Sage process with kill -9 from a terminal, since Sage might not kill child processes, e. g. , Maple processes, or cleanup temporary ? les f rom $HOME/. sage/tmp. ) 3. 1 Your Sage Session The session is the sequence of input and output from when you start Sage until you quit. Sage logs all Sage input, via IPython. In fact, if you’re using the interactive shell (not the notebook interface), then at any point you may type %history (or %hist) to get a listing of all input lines typed so far. You can type ? at the Sage prompt to ? nd out more about IPython, e. g. â€Å"IPython offers numbered prompts with input and output caching. All input is saved and can be retrieved as variables (besides the usual arrow key recall). The following GLOBAL variables always exist (so don’t overwrite them! )†: _: previous input (interactive shell and notebook) __: next previous input (interactive shell only) _oh : list of all inputs (interactive shell only) Here is an example: sage: factor(100) _1 = 2^2 * 5^2 sage: kronecker_symbol(3,5) 51 Sage Tutorial, Release 5. 3 _2 = -1 sage: %hist #This only works from the interacti ve shell, not the notebook. : factor(100) 2: kronecker_symbol(3,5) 3: %hist sage: _oh _4 = {1: 2^2 * 5^2, 2: -1} sage: _i1 _5 = ’factor(ZZ(100)) ’ sage: eval(_i1) _6 = 2^2 * 5^2 sage: %hist 1: factor(100) 2: kronecker_symbol(3,5) 3: %hist 4: _oh 5: _i1 6: eval(_i1) 7: %hist We omit the output numbering in the rest of this tutorial and the other Sage documentation. You can also store a list of input from session in a macro for that session. sage: E = EllipticCurve([1,2,3,4,5]) sage: M = ModularSymbols(37) sage: %hist 1: E = EllipticCurve([1,2,3,4,5]) 2: M = ModularSymbols(37) 3: %hist sage: %macro em 1-2 Macro ‘em‘ created. To execute, type its name (without quotes). sage: E Elliptic Curve defined by y^2 + x*y + 3*y = x^3 + 2*x^2 + 4*x + 5 over Rational Field sage: E = 5 sage: M = None sage: em Executing Macro sage: E Elliptic Curve defined by y^2 + x*y + 3*y = x^3 + 2*x^2 + 4*x + 5 over Rational Field When using the interactive shell, any UNIX shell command can be executed from Sage by prefacing it by an exclamation point !. For example, sage: ! ls auto example. sage glossary. tex t tmp tut. log tut. tex returns the listing of the current directory. The PATH has the Sage bin directory at the front, so if you run gp, gap, singular, maxima, etc. you get the versions included with Sage. sage: ! gp Reading GPRC: /etc/gprc Done. GP/PARI CALCULATOR Version 2. 2. 11 (alpha) i686 running linux (ix86/GMP-4. 1. 4 kernel) 32-bit version 52 Chapter 3. The Interactive Shell Sage Tutorial, Release 5. 3 sage: ! singular SINGULAR A Computer Algebra System for Polynomial Computations 0< by: G. -M. Greuel, G. Pfister, H . Schoenemann FB Mathematik der Universitaet, D-67653 Kaiserslautern October 2005 / / Development version 3-0-1 3. 2 Logging Input and Output Logging your Sage session is not the same as saving it (see Saving and Loading Complete Sessions for that). To log input (and optionally output) use the logstart command. Type logstart? for more details. You can use this command to log all input you type, all output, and even play back that input in a future session (by simply reloading the log ? le). [email  protected]:~$ sage ———————————————————————| SAGE Version 3. 0. 2, Release Date: 2008-05-24 | | Type notebook() for the GUI, and license() for information. | ———————————————————————sage: logstart setup Activating auto-logging. Current session state plus future input saved. Filename : setup Mode : backup Output logging : False Timestamping : False State : active sage: E = EllipticCurve([1,2,3,4,5]). minimal_model() sage: F = QQ^3 sage: x,y = QQ[’x,y’]. gens() sage: G = E. gens() sage: Exiting SAGE (CPU time 0m0. 61s, Wall time 0m50. 39s). [email  protected]:~$ sage ———————————————————————| SAGE Version 3. 0. 2, Release Date: 2008-05-24 | | Type notebook() for the GUI, and license() for information. | ———————————————————————sage: load â€Å"setup† Loading log file one line at a time Finished replaying log file sage: E Elliptic Curve defined by y^2 + x*y = x^3 – x^2 + 4*x + 3 over Rational Field sage: x*y x*y sage: G [(2 : 3 : 1)] If you use Sage in the Linux KDE terminal konsole then you can save your session as follows: after starting Sage in konsole, select â€Å"settings†, then â€Å"history †, then â€Å"set unlimited†. When you are ready to save your session, select â€Å"edit† then â€Å"save history as † and type in a name to save the text of your session to your computer. After saving this ? le, you could then load it into an editor, such as xemacs, and print it. 3. 2. Logging Input and Output 53 Sage Tutorial, Release 5. 3 3. Paste Ignores Prompts Suppose you are reading a session of Sage or Python computations and want to copy them into Sage. But there are annoying >>> or sage: prompts to worry about. In fact, you can copy and paste an example, including the prompts if you want, into Sage. In other words, by de fault the Sage parser strips any leading >>> or sage: prompt before passing it to Python. For example, sage: 2^10 1024 sage: sage: sage: 2^10 1024 sage: >>> 2^10 1024 3. 4 Timing Commands If you place the %time command at the beginning of an input line, the time the command takes to run will be displayed after the output. For example, we can compare the running time for a certain exponentiation operation in several ways. The timings below will probably be much different on your computer, or even between different versions of Sage. First, native Python: sage: %time a = int(1938)^int(99484) CPU times: user 0. 66 s, sys: 0. 00 s, total: 0. 66 s Wall time: 0. 66 This means that 0. 66 seconds total were taken, and the â€Å"Wall time†, i. e. , the amount of time that elapsed on your wall clock, is also 0. 66 seconds. If your computer is heavily loaded with other programs, the wall time may be much larger than the CPU time. Next we time exponentiation using the native Sage Integer type, which is implemented (in Cython) using the GMP library: sage: %time a = 1938^99484 CPU times: user 0. 04 s, sys: 0. 00 s, total: 0. 04 s Wall time: 0. 04 Using the PARI C-library interface: sage: %time a = pari(1938)^pari(99484) CPU times: user 0. 05 s, sys: 0. 00 s, total: 0. 05 s Wall time: 0. 05 GMP is better, but only slightly (as expected, since the version of PARI built for Sage uses GMP for integer arithmetic). You can also time a block of commands using the cputime command, as illustrated below: sage: sage: sage: sage: sage: 0. 4 t = cputime() a = int(1938)^int(99484) b = 1938^99484 c = pari(1938)^pari(99484) cputime(t) # somewhat random output sage: cputime? Return the time in CPU second since SAGE started, or with optional argument t, return the time since time t. 54 Chapter 3. The Interactive Shell Sage Tutorial, Release 5. 3 INPUT: t — (optional) float, time in CPU seconds OUTPUT: float — time i n CPU seconds The walltime command behaves just like the cputime command, except that it measures wall time. We can also compute the above power in some of the computer algebra systems that Sage includes. In each case we execute a trivial command in the system, in order to start up the server for that program. The most relevant time is the wall time. However, if there is a signi? cant difference between the wall time and the CPU time then this may indicate a performance issue worth looking into. sage: time 1938^99484; CPU times: user 0. 01 s, sys: 0. 00 s, total: Wall time: 0. 01 sage: gp(0) 0 sage: time g = gp(’1938^99484’) CPU times: user 0. 00 s, sys: 0. 00 s, total: Wall time: 0. 04 sage: maxima(0) 0 sage: time g = maxima(’1938^99484’) CPU times: user 0. 00 s, sys: 0. 00 s, total: Wall time: 0. 0 sage: kash(0) 0 sage: time g = kash(’1938^99484’) CPU times: user 0. 00 s, sys: 0. 00 s, total: Wall time: 0. 04 sage: mathematica(0) 0 sage: time g = mathematica(’1938^99484’) CPU times: user 0. 00 s, sys: 0. 00 s, total: Wall time: 0. 03 sage: maple(0) 0 sage: time g = maple(’1938^99484’) CPU times: user 0. 00 s, sys: 0. 00 s, total: Wall time: 0. 11 sage: gap(0) 0 sage: time g = gap. eval(’1938^99484;;’) CPU times: user 0. 00 s, sys: 0. 00 s, total: Wall time: 1. 02 0. 01 s 0. 00 s 0. 00 s 0. 00 s 0. 00 s 0. 00 s 0. 00 s Note that GAP and Maxima are the slowest in this test (this was run on the machine sage. ath. washington. edu). Because of the pexpect interface overhead, it is perhaps unfair to compare these to Sage, which is the fastest. 3. 5 Other IPython tricks As noted above, Sage uses IPython as its front end, and so you can use any of IPython’s commands and features. You can read the full IPython documentation. Meanwhile, here are some fun tricks – these are called â€Å"Magic commands† in IPython: †¢ You can use %bg to run a command in the background, and then use jobs to access the results, as follows. 3. 5. Other IPython tricks 55 Sage Tutorial, Release 5. 3 The comments not tested are here because the %bg syntax doesn’t work well with S age’s automatic testing facility. If you type this in yourself, it should work as written. This is of course most useful with commands which take a while to complete. ) sage: def quick(m): return 2*m sage: %bg quick(20) # not tested Starting job # 0 in a separate thread. sage: jobs. status() # not tested Completed jobs: 0 : quick(20) sage: jobs[0]. result # the actual answer, not tested 40 Note that jobs run in the background don’t use the Sage preparser – see The Pre-Parser: Differences between Sage and Python for more information. One (perhaps awkward) way to get around this would be to run sage: %bg eval(preparse(’quick(20)’)) # not tested It is safer and easier, though, to just use %bg on commands which don’t require the preparser. †¢ You can use %edit (or %ed or ed) to open an editor, if you want to type in some complex code. Before you start Sage, make sure that the EDITOR environment variable is set to your favorite editor (by putting export EDITOR=/usr/bin/emacs or export EDITOR=/usr/bin/vim or something similar in the appropriate place, like a . profile ? le). From the Sage prompt, executing %edit will open up the named editor. Then within the editor you can de? e a function: def some_function(n): return n**2 + 3*n + 2 Save and quit from the editor. For the rest of your Sage session, you can then use some_function. If you want to modify it, type %edit some_function from the Sage prompt. †¢ If you have a computation and you want to modify its output for another use, perform the computation and type %rep: this will place the output from the previous command at the Sage prompt, ready for you to edit it. sage: f(x) = cos(x) sage: f(x). derivative(x) -sin(x) At this point, if you type %rep at the Sage prompt, you will get a new Sage prompt, followed by -sin(x), with the cursor at the end of the line. For more, type %quickref to get a quick reference guide to IPython. As of this writing (April 2011), Sage uses version 0. 9. 1 of IPython, and the documentation for its magic commands is available online. 3. 6 Errors and Exceptions When something goes wrong, you will usually see a Python â€Å"exception†. Python even tries to suggest what raised the exception. Often you see the name of the exception, e. g. , NameError or ValueError (see the Python Reference Manual [Py] for a complete list of exceptions). For example, sage: 3_2 ———————————————————–File â€Å"†, line 1 ZZ(3)_2 ^ SyntaxError: invalid syntax 6 Chapter 3. The Interactive Shell Sage Tutorial, Release 5. 3 sage: EllipticCurve([0,infinity]) ———————————————— Ã¢â‚¬â€Ã¢â‚¬â€Ã¢â‚¬â€œTraceback (most recent call last): TypeError: Unable to coerce Infinity () to Rational The interactive debugger is sometimes useful for understanding what went wrong. You can toggle it on or off using %pdb (the default is off). The prompt ipdb> appears if an exception is raised and the debugger is on. From within the debugger, you can print the state of any local variable, and move up and down the execution stack. For example, sage: %pdb Automatic pdb calling has been turned ON sage: EllipticCurve([1,infinity]) ————————————————————————– Traceback (most recent call last) ipdb> For a list of commands in the debugger, type ? at the ipdb> prompt: ipdb> ? Documented commands (type help ): ======================================== EOF break commands debug h a bt condition disable help alias c cont down ignore args cl continue enable j b clear d exit jump whatis where Miscellaneous help topics: ========================== exec pdb Undocumented commands: ====================== retval rv list n next p pdef pdoc pinfo pp q quit r return s step tbreak u unalias up w Type Ctrl-D or quit to return to Sage. 3. 7 Reverse Search and Tab Completion Reverse search: Type the beginning of a command, then Ctrl-p (or just hit the up arrow key) t o go back to each line you have entered that begins in that way. This works even if you completely exit Sage and restart later. You can also do a reverse search through the history using Ctrl-r. All these features use the readline package, which is available on most ? avors of Linux. To illustrate tab completion, ? st create the three dimensional vector space V = Q3 as follows: sage: V = VectorSpace(QQ,3) sage: V Vector space of dimension 3 over Rational Field You can also use the following more concise notation: 3. 7. Reverse Search and Tab Completion 57 Sage Tutorial, Release 5. 3 sage: V = QQ^3 Then it is easy to list all member functions for V using tab completion. Just type V. , then type the [tab key] key on your keyboard: sage: V. [tab key] V. _VectorSpace_generic__base_field V. ambient_space V. base_field V. base_ring V. basis V. coordinates V. zero_vector If you type the ? st few letters of a function, then [tab key], you get only functions that begin as indicated. sage: V. i[tab key] V. is_ambient V. is_dense V. is_full V. is_sparse If you wonder what a particular function does, e. g. , the coordinates function, type V. coordinates? for help or V. coordinates for the source code, as explained in the next section. 3. 8 Integrated Help System Sage features an integrated help facility. Type a function name followed by ? for the documentation for that function. sage: V = QQ^3 sage: V. coordinates? Type: instancemethod Base Class: String Form: Namespace: Interactive File: /home/was/s/local/lib/python2. /site-packages/sage/modules/f ree_module. py Definition: V. coordinates(self, v) Docstring: Write v in terms of the basis for self. Returns a list c such that if B is the basis for self, then sum c_i B_i = v. If v is not in self, raises an ArithmeticError exception. EXAMPLES: sage: M = FreeModule(IntegerRing(), 2); M0,M1=M. gens() sage: W = M. submodule([M0 + M1, M0 – 2*M1]) sage: W. coordinates(2*M0-M1) [2, -1] As shown above, the output tells you t he type of the object, the ? le in which it is de? ned, and a useful description of the function with examples that you can paste into your current session. Almost all of these examples are regularly automatically tested to make sure they work and behave exactly as claimed. 58 Chapter 3. The Interactive Shell Sage Tutorial, Release 5. 3 Another feature that is very much in the spirit of the open source nature of Sage is that if f is a Python function, then typing f displays the source code that de? nes f. For example, sage: V = QQ^3 sage: V. coordinates Type: instancemethod Source: def coordinates(self, v): â€Å"†Ã¢â‚¬  Write $v$ in terms of the basis for self. â€Å"†Ã¢â‚¬  return self. coordinate_vector(v). list() This tells us that all the coordinates function does is call the coordinate_vector function and change the result into a list. What does the coordinate_vector function do? sage: V = QQ^3 sage: V. coordinate_vector def coordinate_vector(self, v): return self. ambient_vector_space()(v) The coordinate_vector function coerces its input into the ambient space, which has the effect of computing the vector of coef? cients of v in terms of V . The space V is already ambient since it’s just Q3 . There is also a coordinate_vector function for subspaces, and it’s different. We create a subspace and see: sage: V = QQ^3; W = V. span_of_basis([V. 0, V. 1]) sage: W. coordinate_vector def coordinate_vector(self, v): â€Å"†Ã¢â‚¬  â€Å"†Ã¢â‚¬  # First find the coordinates of v wrt echelon basis. w = self. echelon_coordinate_vector(v) # Next use transformation matrix from echelon basis to # user basis. T = self. echelon_to_user_matrix() return T. linear_combination_of_rows(w) (If you think the implementation is inef? cient, please sign up to help optimize linear algebra. ) You may also type help(command_name) or help(class) for a manpage-like help ? le about a given class. age: help(VectorSpace) Help on class VectorSpace class VectorSpace(__builtin__. object) | Create a Vector Space. | | To create an ambient space over a field with given dimension | using the calling syntax : : When you type q to exit the help system, your session appears just as it was. The help listing does not clutter up your session, unlike the output of function_name? som etimes does. It’s particularly helpful to type 3. 8. Integrated Help System 59 Sage Tutorial, Release 5. 3 help(module_name). For example, vector spaces are de? ned in sage. modules. free_module, so type help(sage. modules. ree_module) for documentation about that whole module. When viewing documentation using help, you can search by typing / and in reverse by typing ?. 3. 9 Saving and Loading Individual Objects Suppose you compute a matrix or worse, a complicated space of modular symbols, and would like to save it for later use. What can you do? There are several approaches that computer algebra systems take to saving individual objects. 1. Save your Game: Only support saving and loading of complete sessions (e. g. , GAP, Magma). 2. Uni? ed Input/Output: Make every object print in a way that can be read back in (GP/PARI). 3. Eval: Make it easy to evaluate arbitrary code in the interpreter (e. g. , Singular, PARI). Because Sage uses Python, it takes a different approach, which is that every object can be serialized, i. e. , turned into a string from which that object can be recovered. This is in spirit similar to the uni? ed I/O approach of PARI, except it doesn’t have the drawback that objects print to screen in too complicated of a way. Also, support for saving and loading is (in most cases) completely automatic, requiring no extra programming; it’s simply a feature of Python that was designed into the language from the ground up. Almost all Sage objects x can be saved in compressed form to disk using save(x, filename) (or in many cases x. save(filename)). To load the object back in, use load(filename). sage: sage: [ 15 [ 42 [ 69 sage: A = MatrixSpace(QQ,3)(range(9))^2 A 18 21] 54 66] 90 111] save(A, ’A’) You should now quit Sage and restart. Then you can get A back: sage: sage: [ 15 [ 42 [ 69 A = load(’A’) A 18 21] 54 66] 90 111] You can do the same with more complicated objects, e. g. , elliptic curves. All data about the object that is cached is stored with the object. For example, sage: sage: sage: sage: E = EllipticCurve(’11a’) v = E. nlist(100000) save(E, ’E’) quit # takes a while The saved version of E takes 153 kilobytes, since it stores the ? rst 100000 an with it. ~/tmp$ ls -l E. sobj -rw-r–r– 1 was was 153500 2006-01-28 19:23 E. sobj ~/tmp$ sage [ ] sage: E = load(’E’) sage: v = E. anlist(100000) # instant! (In Pytho n, saving and loading is accomplished using the cPickle module. In particular, a Sage object x can be saved via cPickle. dumps(x, 2). Note the 2! ) 60 Chapter 3. The Interactive Shell Sage Tutorial, Release 5. 3 Sage cannot save and load individual objects created in some other computer algebra systems, e. . , GAP, Singular, Maxima, etc. They reload in a state marked â€Å"invalid†. In GAP, though many objects print in a form from which they can be reconstructed, many don’t, so reconstructing from their print representation is purposely not allowed. sage: a = gap(2) sage: a. save(’a’) sage: load(’a’) Traceback (most recent call last): ValueError: The session in which this object was defined is no longer running. GP/PARI objects can be saved and loaded since their print representation is enough to reconstruct them. sage: a = gp(2) sage: a. save(’a’) sage: load(’a’) 2 Saved objects can be re-loaded later on computers with different architectures or operating systems, e. g. , you could save a huge matrix on 32-bit OS X and reload it on 64-bit Linux, ? nd the echelon form, then move it back. Also, in many cases you can even load objects into versions of Sage that are different than the versions they were saved in, as long as the code for that object isn’t too different. All the attributes of the objects are saved, along with the class (but not source code) that de? nes the object. If that class no longer exists in a new version of Sage, then the object can’t be reloaded in that newer version. But you could load it in an old version, get the objects dictionary (with x. __dict__), and save the dictionary, and load that into the newer version. 3. 9. 1 Saving as Text You can also save the ASCII text representation of objects to a plain text ? le by simply opening a ? le in write mode and writing the string representation of the object (you can write many objects this way as well). When you’re done writing objects, close the ? le. sage: sage: sage: sage: sage: R. = PolynomialRing(QQ,2) f = (x+y)^7 o = open(’file. txt’,’w’) o. write(str(f)) o. close() 3. 10 Saving and Loading Complete Sessions Sage has very ? xible support for saving and loading complete sessions. The command save_session(sessionname) saves all the variables you’ve de? ned in the current session as a dictionary in the given sessionname. (In the rare case when a variable does not support saving, it is simply not saved to the dictionary. ) The resulting ? le is an . sobj ? le and can be loaded just like any other object that was saved. When you load the objects saved in a session, you get a dictionary whose keys are the variables names and whose values are the objects. You can use the load_session(sessionname) command to load the variables de? ed in sessionname into the current session. Note that this does not wipe out variables you’ve already de? ned in your current session; instead, the two sessions are merged. First we start Sage and de? ne some variables. 3. 10. Saving and Loading Complete Sessions 61 Sage Tutorial, Release 5. 3 sage: sage: sage: sage: _4 = E = EllipticCurve(’11a’) M = ModularSymbols(37) a = 389 t = M. T(2003). matrix(); t. charpoly(). factor() (x – 2004) * (x – 12)^2 * (x + 54)^2 Next we save our session, which saves each of the above variables into a ? le. Then we view the ? le, which is about 3K in size. age: save_session(’misc’) Saving a Saving M Saving t Saving E sage: quit [ email  protected]:~/tmp$ ls -l misc. sobj -rw-r–r– 1 was was 2979 2006-01-28 19:47 misc. sobj Finally we restart Sage, de? ne an extra variable, and load our saved session. sage: b = 19 sage: load_session(’misc’) Loading a Loading M Loading E Loading t Each saved variable is again available. Moreover, the variable b was not overwritten. sage: M Full Modular Symbols space for Gamma_0(37) of weight 2 with sign 0 and dimension 5 over Rational Field sage: E Elliptic Curve defined by y^2 + y = x^3 – x^2 – 10*x – 20 over Rational Field sage: b 19 sage: a 389 3. 1 The Notebook Interface The Sage notebook is run by typing sage: notebook() on the command line of Sage. This starts the Sage notebook and opens your default web browser to view it. The server’s state ? les are stored in $HOME/. sage/sage\_notebook. Other options include: sage: notebook(â€Å"directory†) which starts a new notebook server using ? les in the given dir ectory, instead of the default directory $HOME/. sage/sage_notebook. This can be useful if you want to have a collection of worksheets associated with a speci? c project, or run several separate notebook servers at the same time. When you start the notebook, it ? st creates the following ? les in $HOME/. sage/sage_notebook: 62 Chapter 3. The Interactive Shell Sage Tutorial, Release 5. 3 nb. sobj objects/ worksheets/ (the notebook SAGE object file) (a directory containing SAGE objects) (a directory containing SAGE worksheets). After creating the above ? les, the notebook starts a web server. A â€Å"notebook† is a collection of user accounts, each of which can have any number of worksheets. When you create a new worksheet, the data that de? nes it is stored in the worksheets/username/number directories. In each such directory there is a plain text ? le worksheet. xt – if anything ever happens to your worksheets, or Sage, or whatever, that human-readable ? le contains ev erything needed to reconstruct your worksheet. From within Sage, type notebook? for much more about how to start a notebook server. The following diagram illustrates the architecture of the Sage Notebook: ———————| | | | | firefox/safari | | | | javascript | | program | | | | | ———————| ^ | AJAX | V | ———————| | | sage | | web | ————> | server | pexpect | | | | ———————- SAGE process 1 SAGE process 2 SAGE process 3 (Python processes) For help on a Sage command, cmd, in the notebook browser box, type cmd? ). and now hit (not For help on the keyboard shortcuts available in the notebook interface, click on the Help link. 3. 11. The Notebook Interface 63 Sage Tutorial, Release 5. 3 64 Chapter 3. The Interactive Shell CHAPTER FOUR INTERFACES A central facet of Sage is that it supports computation with objects in many different computer algebra systems â€Å"under one roof† using a common interface and clean programming language. The console and interact methods of an interface do very different things. For example, using GAP as an example: 1. gap. onsole(): This opens the GAP console – it transfers control to GAP. Here Sage is serving as nothing more than a convenient program launcher, similar to the Linux bash shell. 2. gap. interact(): This is a convenient way to interact with a running GAP instance that may be â€Å"full of† Sage objects. You can import Sage objects into this GAP session (even from the interactive interface), etc. 4. 1 GP/PARI PARI is a compact, very mature, highly optimized C program whose primary focus is number theory. There are two very distinct interfaces that you can use in Sage: †¢ gp – the â€Å"G o P ARI† interpreter, and †¢ pari – the PARI C libraxry. For example, the following are two ways of doing the same thing. They look identical, but the output is actually different, and what happens behind the scenes is drastically different. sage: gp(’znprimroot(10007)’) Mod(5, 10007) sage: pari(’znprimroot(10007)’) Mod(5, 10007) In the ? rst case, a separate copy of the GP interpreter is started as a server, and the string ’znprimroot(10007)’ is sent to it, evaluated by GP, and the result is assigned to a variable in GP (which takes up space in the child GP processes memory that won’t be freed). Then the value of that variable is displayed. In the second case, no separate program is started, and the string ’znprimroot(10007)’ is evaluated by a certain PARI C library function. The result is stored in a piece of memory on the Python heap, which is freed when the variable is no longer referenced. The objects have different types: sage: type(gp(’znprimroot(10007)’)) sage: type(pari(’znprimroot(10007)’)) So which should you use? It depends on what you’re doing. The GP interface can do absolutely anything you could do in the usual GP/PARI command line program, since it is running that program. In particular, you can load complicated PARI programs and run them. In contrast, the PARI interface (via the C library) is much more restrictive. First, not all 65 Sage Tutorial, Release 5. 3 member functions have been implemented. Second, a lot of code, e. g. , involving numerical integration, won’t work via the PARI interface. That said, the PARI interface can be signi? cantly faster and more robust than the GP one. (If the GP interface runs out of memory evaluating a given input line, it will silently and automatically double the stack size and retry that input line. Thus your computation won’t crash if you didn’t correctly anticipate the amount of memory that would be needed. This is a nice trick the usual GP interpreter doesn’t seem to provide. Regarding the PARI C library interface, it immediately copies each created object off of the PARI stack, hence the stack never grows. However, each object must not exceed 100MB in size, or the stack will over? ow when the object is being created. This extra copying does impose a slight performance penalty. ) In summary, Sage uses the PARI C library to provide functionality similar to that provided by the GP/PARI interpreter, except with different sophisticated memory management and the Python programming language. First we create a PARI list from a Python list. age: v = pari([1,2,3,4,5]) sage: v [1, 2, 3, 4, 5] sage: type(v) Every PARI object is of type py_pari. gen. The PARI type of the underlying object can be obtained using the type member function. sage: v. type() ’t_VEC’ In PARI, to create an elliptic curve we enter ellinit([1,2,3,4,5]). Sage is similar, except that ellinit is a method th at can be called on any PARI object, e. g. , our t\_VEC v. sage: e = v. ellinit() sage: e. type() ’t_VEC’ sage: pari(e)[:13] [1, 2, 3, 4, 5, 9, 11, 29, 35, -183, -3429, -10351, 6128487/10351] Now that we have an elliptic curve object, we can compute some things about it. age: e. elltors() [1, [], []] sage: e. ellglobalred() [10351, [1, -1, 0, -1], 1] sage: f = e. ellchangecurve([1,-1,0,-1]) sage: f[:5] [1, -1, 0, 4, 3] 4. 2 GAP Sage comes with GAP 4. 4. 10 for computational discrete mathematics, especially group theory. Here’s an example of GAP’s IdGroup function, which uses the optional small groups database that has to be installed separately, as explained below. sage: G = gap(’Group((1,2,3)(4,5), (3,4))’) sage: G Group( [ (1,2,3)(4,5), (3,4) ] ) sage: G. Center() Group( () ) 66 Chapter 4. Interfaces Sage Tutorial, Release 5. 3 sage: G. IdGroup() [ 120, 34 ] sage: G. Order() 120 # requires optional database_gap package We can do the same computation in Sage without explicitly invoking the GAP interface as follows: sage: G = PermutationGroup([[(1,2,3),(4,5)],[(3,4)]]) sage: G. center() Subgroup of (Permutation Group with generators [(3,4), (1,2,3)(4,5)]) generated by [()] sage: G. group_id() # requires optional database_gap package [120, 34] sage: n = G. order(); n 120 (For some GAP functionality, you should install two optional Sage packages. Type sage -optional for a list and choose the one that looks like gap\_packages-x. . z, then type sage -i gap\_packages-x. y. z. Do the same for database\_gap-x. y. z. Some non-GPL’d GAP packages may be installed by downloading them from the GAP web site [GAPkg], and unpacking them in $SAGE_ROOT/local/lib/gap-4. 4. 10/pkg. ) 4. 3 Singular Singular provides a massive and mature library for Grobner bases, multivariate polynomial gcds, bases of RiemannRoch spaces of a plane curve, and factorizations, among other things. We illustrate multivariate polynomial factorization using the Sage interface to Singular (do not type the ): sage: R1 = singular. ing(0, ’(x,y)’, ’dp’) sage: R1 // characteristic : 0 // number of vars : 2 // block 1 : ordering dp // : names x y // block 2 : ordering C sage: f = singular(’9*y^8 – 9*x^2*y^7 – 18*x^3*y^6 – 18*x^5*y^6 + 9*x^6*y^4 + 18*x^7*y^5 + 36*x^8*y^4 + 9*x^10*y^4 – 18*x^11*y^2 – 9*x^12*y^3 – 18*x^13*y^2 + 9*x^16’) Now that we have de? ned f , we print it and factor. sage: f 9*x^16-18*x^13*y^2-9*x^12*y^3+9*x^10*y^4-18*x^11*y^2+36*x^8*y^4+18*x^7*y^5-18*x^5*y^6+9*x^6*y^4-18*x^ sage: f. parent() Singular sage: F = f. factorize(); F [1]: _[1]=9 _[2]=x^6-2*x^3*y^2-x^2*y^3+y^4 _[3]=-x^5+y^2 [2]: 1,1,2 sage: F[1][2] x^6-2*x^3*y^2-x^2*y^3+y^4 As with the GAP example in GAP, we can compute the above factorization without explicitly using the Singular interface (however, behind the scenes Sage uses the Singular interface for the actual computation). Do not type the : 4. 3. Singular 67 Sage Tutorial, Release 5. 3 sage: sage: sage: (9) * x, y = QQ[’x, y’]. gens() f = 9*y^8 – 9*x^2*y^7 – 18*x^3*y^6 – 18*x^5*y^6 + 9*x^6*y^4 + 18*x^7*y^5 + 36*x^8*y^4 + 9*x^10*y^4 – 18*x^11*y^2 – 9*x^12*y^3 – 18*x^13*y^2 + 9*x^16 factor(f) (-x^5 + y^2)^2 * (x^6 – 2*x^3*y^2 – x^2*y^3 + y^4) 4. 4 Maxima Maxima is included with Sage, as well as a Lisp implementation. The gnuplot package (which Maxima uses by default for plotting) is distributed as a Sage optional package. Among other things, Maxima does symbolic manipulation. Maxima can integrate and differentiate functions symbolically, solve 1st order ODEs, most linear 2nd order ODEs, and has implemented the Laplace tr

Monday, July 29, 2019

Answer the question for the journal -this is for health ethics and law Essay

Answer the question for the journal -this is for health ethics and law class - Essay Example The legal and ethical issue here is informed consent. This occurs when a health practitioner gets permission from the patient to carry out an intervention. Three elements must be present for this to occur. These are disclosure, competence and voluntariness (Irvine, Osborne & Shariff, 2003). Disclosure calls for the doctor or nurse to make sure that the patient understands the purpose, benefits and risks of the intervention. In the case of the 64 year old woman, the team informed the patient on the need for her to be placed on tube feeding. Voluntariness implies that no coercion should occur and the involved party must be able to decide on his own. The ethical element in question here is the competency of the old woman. This issue arises from the fact that she is not able to sustain her decision. According to Irvine, Osborne & Shariff (2003), the ability of a patient to give informed consent is governed by the legal requirement for competency. In the common law jurisdictions, adults are presumed to be competent to give their consent. This is, however, rebutted in cases of mental illnesses or when a patient is not able to sustain his or her decisions long enough to allow for the intervention to be implanted. This is the case with the old woman. In such an instance, two options are available; the team must either catch the patient in lucid state or go the health proxy way. According to Fisher (2013), when a doctor or nurse has realized that the patient is having a variable decision making capacity due to the underlying disease, he or she must be assessed in the different states and the outcomes documented in each contact. If the patient makes consistent decisions over time when he or she is in the lucid state, it may be used in making the decision as it will be deemed adequate enough. In the case involving the 64 year old female patient, the team

Sunday, July 28, 2019

Millennial Generation Assignment Example | Topics and Well Written Essays - 500 words

Millennial Generation - Assignment Example As such, the changes associated with this group cannot be easily understood at times. The imprints of the generation are moved in the lifecycle of the people, with the most significant impression being seen among the youth. The millennials are considered to be vulnerable to interference. This is claimed to be as a result of multitasking. Despite science claiming that multitasking is a myth, it is quite evident that this generation shows extraordinary multi-tasking abilities. This is seen in places of work and at home. Millennials have grown exposed to a variety of technological advancements and this has motivated them to carry out several duties and activities at the same time. They are always putting their brains with the extensive multitasking training. Evidence has shown that long time engagement in the simultaneous playing of video games, doing assignments and watching television has reduced the ability of the brain to perform thus, making them more vulnerable. It is, however, worth noting that the multi-tasking has allowed them to increase their brain processing speed making the ability to quickly learn and adapt to new environments. There is a popular belief that millennials are more caring and more community oriented. This is shown by their ability to show concern to their colleagues at home and in their places of work. According to Chip, Ukleja, and Rusch, the caring aspect of this generation comes from the environment that such people grow up in. Their childhood is affected by family and social influences that ensure that they develop to become people interested in extrinsic life goals (102). Several products like reality Television, iWorld, and NCLB exposes the generation to the external world and motivates them to engage others socially and culturally. In the long run, it makes them engaged in external life aspects and promotes a caring attitude or trait among them. The millennials are also more open-minded as compared to other generations.  

Saturday, July 27, 2019

RESEARCH METHODS FOR MANAGERS Assignment Example | Topics and Well Written Essays - 1500 words

RESEARCH METHODS FOR MANAGERS - Assignment Example The ability to form teams virtually that will operate across the limitations of time, distance and organizational boundaries have proven to be the successful for the organizations. These teams use electronic collaboration technologies and other techniques to lower facility and travelling costs, reduce project schedules and improve decision making communication and time. Since companies are more focused on foreign markets for expanding their base of customer, they are also looking at lowering costs or exacting effectiveness by tapping the foreign labor pool. For this purpose, outsourcing and off- shoring have become very prevalent. The result is that firms are able to achieve substantial cost saving and decrease their time to market when building software solutions, offering services, manufacturing products since additional risks are managed effectively (Gruhn, Volker, Schope & Lothar, 2002, P. 254). Today the management desires to establish international presence by exacting operatin g efficiencies and reducing costs of distributed teams created by mergers, acquisitions, technical specialization and downsizing. Organizations that do not use virtual teams effectively have difficulty in competing in the global, competitive and rapidly changing markets. Those organizations that will succeed in finding ways of working across boundaries like systems, technologies, people and procedure. Literature Review Managing virtual teams can be more complex than managing traditional teams, however. First, virtual teams primarily communicate and collaborate by using technology such as e-mail, groupware, etc. Virtual teams exclusively depend on software and technology tools to collaborate and communication, whereas the teams that are traditional can always abandon technology and software tools in favor of face-to-face communication and collaboration. Secondly, boundaries were crossed by virtual teams in relation to organization, distance, and time. This raises the need of attentio n towards the issues of collaboration and communication