Tuesday, August 25, 2020

Scarletletter Symbolism :: essays research papers

The Scarlet Letter, by Nathaniel Hawthorne utilizes numerous things for imagery and as I would like to think the most representative were the platform scenes. There are an aggregate of three framework scenes and each has its own motivation and significance. Without the platform scenes this book would fundamentally leave you confused whatever was truly going on in light of the fact that the framework scenes truly mention to you what is happening and why. Â Â Â Â Â The first framework scene is essentially a prologue to the entire book. You realize who all the principle sanctions are and above all Hester and her horrendous wrongdoing she submitted. This is the first run through everybody sees Hester with the letter “A'; on her chest. Hester is an extremely valiant lady for standing up on that platform before everybody in the town to stare at and for conceding that she had submitted infidelity. Additionally, it takes an exceptionally brave individual to stand up for what they put stock in as she did by not telling who she had carried out the wrongdoing with. The entire story develops you to this purpose of discovering who Hester submitted infidelity with. By this point in the story you have some hint who the dad of Pearl is yet until you get to the second platform scene you don’t know without a doubt. At the second framework scene Dimesdale is on the platform and Hester and Pearl come up and go along with him. Dimesdale is wearing out by the weight of his transgression he submitted. He goes to the framework to admit to God and request a pardoning. At that point a cloud frames the letter “A'; in the sky and everybody thinks this represents heavenly attendant in light of the fact that that’s how they see Dimesdale. At that point when Dimesdale goes to leave he leaves his glove on the framework to represent he was there and that he ought to have been up there with Hester and his little girl in any case. At that point when you think everything is going to end up being alright and nothing terrible will happen to Hester and Pearl, Dimesdale goes up on the framework. This concerns Hester like it would anybody in her position. So Hester and Pearl go along with him again on the platform. Hester is wearing the Scarlet Letter like consistently and afterward Dimesdale shows his letter “A'; that he engraved over his heart.

Saturday, August 22, 2020

Cover Letter stating interest and intent Essay Example | Topics and Well Written Essays - 250 words

Introductory Letter expressing interest and goal - Essay Example Moreover, as an investigation understudy during Seoul Korea instructive excursion, I procured powerful open organization arrangements. The authority and organization aptitudes stay imperious in successful administration of Fort Collins people group and inception of monetary exercises. Other than the previously mentioned aptitudes, I have had thorough involvement with feasible and effective research as a recipient of Seoul Metropolitan Government. Additionally, monetary advancement experience picked up as an understudy at City of Clermont would be oppressive in helping me build up suitable financial exercises for development of Fort Collins and its locale. Moreover, I would have the best capacity to start productive arranging and the board programs that would elevate economy of Fort Collins’ people group Besides, I have procured extraordinary arranging, coordination, and the board abilities as an understudy and understudy. I foresee to graduate with an experts degree in urban and territorial arranging and I accept that the course have furnished me with phenomenal association procedures that would effective execute the laid out obligations and duties. Additionally, assistant involvement with Osceola and City associations conceded me a quick involvement with open cooperation, communication, arranging, and improvement aptitudes that I accept would be definitive in organization and the board of the association. Moreover, my adaptable and accommodative relational abilities, regular inclination for change and working with individuals would be irreplaceable in building up an outcome arranged workforce at your strong

Tuesday, August 4, 2020

Book Riots Deals of the Day for July 27th, 2017

Book Riots Deals of the Day for July 27th, 2017 Book Riot Deals is sponsored by the darkly irresistible new fantasy Daughter of the Burning City, by Amanda Foody: Todays Featured Deals Rich and Pretty by Rumann Alam for $1.99. Get it here or just click the cover image below: Girl Through Glass by Sari Wilson for $1.99. Get it here or just click the cover image below: In Case You Missed Yesterdays Most Popular Deal: Horrorstor by Grady Hendrix for $1.99. Get it here or just click the cover image below: Previous daily deals that are still active (as of this writing at least). Get em while theyre hot. The Small Backs of Children  by Lydia Luknavitch for $1.99. I Thought It Was Just Me (But It Isnt)  by Brene Brown for $1.99. The Forty Rules of Love  by Elif Shafak for $1.99. Surfacing  by Margaret Atwood for $1.99. Ancillary Justice  by Ann Leckie for $2.99. 10% Happier  by Dan Harris for $1.99. Kindred  by Octavia Butler for $1.99. The Fifth Season  by N.K. Jemisin for $2.99. How to Start a Fire  by Lisa Lutz for $2.99. The Passage  by Justin Cronin for $1.99. Night Film  by Marisha Pessl for $1.99. Shogun  by James Clavell for $1.99. The Notorious RGB  for $1.99. The Valley of Amazement  by Amy Tan for $1.99. The Girl with All the Gifts  by M.R. Carey for $1.99. Graceling  by Kristin Cashore for $1.99. The Rules of Civility  by Amor Towles for $3.99. Ayiti by Roxane Gay for $1.99 Dawn by Octavia E. Butler for $1.99. The Looking Glass War by John Le Carre for $1.99. The Complete Stories by Clarice Lispector for $1.99. Too Like the Lightning by Ada Palmer for $2.99. Mothers Sons by Colm Toibin for $1.99. The Birthday of the World and Other Stories by Ursula K. Le Guin for $1.99. Galileos Daughter by Dava Sobel for $1.99. Brown Girl, Dreaming by Jacqueline Woodson for $1.99. An Edible History of Humanity by Tom Standage for $1.99. Tell the Wolves Im Home by Carol Rifka Brunt for $1.99. Zen in the Art of Writing by Ray Bradbury for $1.99. After Henry by Joan Didion for $1.13. The Song of Achilles by Madeline Miller for $1.99. The Toughest Indian in the World by Sherman Alexie for $1.99. The Last Samurai  by Helen DeWitt for $1.99. The Last Policeman  by Ben H. Winters for $1.99. Notes of a Native Son  by James Baldwin for $1.99. Labyrinths  by Jose Luis Borges for $1.99. All the Birds in the Sky  by Charlie Jane Anders for $2.99. A Study in Scarlet Women  by Sherry Thomas for $1.99.. The Inexplicable Logic of My Life  by Benjamin Alire Sáenz for $2.99. We, The Drowned  by Carsten Jenson for $2.99 Big Fish  by Daniel Wallace for $1.99. The Terracotta Bride  by Zen Cho for $1.40. The Geek Feminist Revolution  by Kameron Hurley for $2.99. The Girl at Midnight  by Melissa Grey for $1.99. Cloudsplitter  by Russell Banks for $1.99. Queenpin  by Megan Abbott for $0.99. The Good Lord Bird  by James McBride for $4.99. The Comet Seekers by Helen Sedgwick for $2.99 Frog Music by Emma Donoghue for $1.99 Bitch Planet, Vol 1 for $3.99. Monstress, Vol 1 by Liu Takeda for $3.99 Paper Girls, Vol 1. by Vaughn, Chiang, Wilson for $3.99. Labyrinth Lost by Zoraida Cordova for $1.99 The Wicked + The Divine Volume 1  for $3.99 The Inheritance Trilogy by N.K. Jemisin for $9.99 The Price of Salt by Patricia Highsmith for $0.99 We Should All Be Feminists by Chimamanda Ngozi Adichie for $2.99 Sign up for our Book Deals newsletter and get up to 80% off books you actually want to read.

Saturday, May 23, 2020

Irony in Swifts A Modest Proposal Essay - 790 Words

Although I realize your concern, you have missed the point of this well thought out essay completely. Despite what you may think about A Modest Proposal by Jonathan Swift, this essay is a satire master piece filled with irony. Swift’s essay was not intended to convince people to eat babies, but to call attention to the abuses Catholic’s face from their well-to-do Protestants. He only uses eating babies in his essay to explain to the reader the impossible burdens the Protestants are imposing on the Irish Catholics and by making their life hard, they are making a life of a new born impossible. He makes his first point on page 411 when he tells the reader that eating babies is no problem for landlords because they have â€Å"already devoured†¦show more content†¦He is saying that Protestants are not caring and are ready to ruin the lives of many others. By saying that when asked as an adult, a Catholic would rather have been â€Å"sold at a year old†¦an d thereby avoided†¦misfortunes†¦ [and the] impossibility of paying rent† (416), he is again pointing out the mercilessness of Protestants. He is not saying that these people would like to be sold as food so cooking them up is acceptable, but bringing the point back to the fact that Protestants are being too cruel on innocent lives. Overall, Swift is also using irony by relating this unheard of cruelty to babies to cruelty animals. He suggests that buying children alive and â€Å"dressing them hot from the knife as we do roasting pigs† (411) is the best way to serve them. This was intended to tell the audience that the Protestants are basically treating the Catholics like animals with no regard to life. This carefully crafted technique lets the reader see how malicious the Protestants are actually being, and that they are killing Catholic babies alive by ruining any chance at a good life. Swift did not actually mean for people to go out and cook babies lik e pigs to get the most satisfactory, he simply meant that if you are going to treat them like pigs, you might as well eat them like pigs. If the people of Britain can’t see that through adults, maybeShow MoreRelatedIrony in Jonathan Swifts A Modest Proposal1101 Words   |  5 Pagesusually kept serious and Irony and satire are widely used in such writings. On the other hand while describing the recent developments in genetic engineering, the tone would be objective and humor or satire would be ineffective here. Jonathan Swift was famous for his sarcastic remarks on the government of his days and his works are full of satire and irony which appear to be humorous but carry a sharp edge which make them effective for expressing political ideas. â€Å"Irony refers either to a situationRead MoreModest Proposal Analysis Essay1122 Words   |  5 Pagesâ€Å"A Modest Proposal† is an essay written by Jonathan Swift as a reaction to the social problem faced by the Irish in 1720’s. Swift’s daring dark and social satire and dark irony to make a statement in this literary work triggered the minds of the rich Englishmen and Irish landlords to question their actions towards the poor Irish people. By giving a drop of horror and barbarity sarcastically, Swift was able to attack the practices of those who were seated in power and exploited the rights of the impoverishedRead MoreJuvenelian Satire in A Modest Proposal by Jonathan Swift Essay1052 Words   |  5 Pagesgrievances or concern s can fall upon deaf ears and change can be slow or non-existent. However, Jonathan Swift in his pamphlet A Modest Proposal, uses clever, targeted, and ironic criticism to bring the social state of Ireland to the attention of indolent aristocrats. He accomplishes such criticism through satire, specifically Juvenalian satire. Swift’s A Modest Proposal stands as an example of the type of satire that plays upon the audience’s emotion by creating anger concerning the indifferenceRead MoreSatire Modest Proposal Essay837 Words   |  4 Pagesupon deaf ears and change can be slow or non-existent. However some social commentators, such as Jonathan Swift in his pamphlet A Modest Proposal, use clever, targeted, and ironic criticism to bring the social state of Ireland to the attention of indolent aristocrats. He accomplishes such criticism through satire, specifically Juvenanlian satire. Swift’s A Modest Proposal stands as a perfect example of the type of satire that pl ays upon the audience’s emotion by creating anger concerning the indifferenceRead MoreSatire of a Modest Proposal Essay1331 Words   |  6 PagesIrony is a beautiful technique exercised to convey a message or call a certain group of people to action. This rhetorical skill is artfully used by Jonathan Swift in his pamphlet â€Å"A Modest Proposal.† The main argument for this mordantly ironic essay is to capture the attention of a disconnected and indifferent audience. Swift makes his point by stringing together a dreadfully twisted set of morally untenable positions in order to cast blame and aspersions on his intended audience. Jonathan Swift’sRead MoreJonathan Swifts A Modest Proposal949 Words   |  4 Pages â€Å"A Modest Proposal† by Jonathan Swift takes place in Dublin Ireland in the 18th century. The narrator is a very ironic character. His â€Å"modest† proposal is anything but modest. This short story takes place during a famine. Since there was a famine, Swift proposes the idea that people sell their one year old children to the rich so they would not be a burden to their family. One important way in which the author engages the audience’s attention and tries to help his readers see deeper politicalRead MoreJonathan Swift Satire Analysis1108 Words   |  5 Pagesomparing Irony In both Mark Twain and Jonathan Swift’s articles there is an effective use of irony. Irony in satirical writing is normally used for the speaker to convey the opposite intended meaning to which they are stating; along with antiphrasis, the use of a word when the opposite meaning is implied, irony makes a valuable asset to satirical literature. The sarcastic use of irony was input to both readings to express the writer’s disappointment towards their societies teachings during theirRead MoreA Modest Proposal For Preventing The Children Of Poor People1458 Words   |  6 Pages whose hard-hitting essay â€Å"A Modest Proposal For Preventing the Children of Poor People in Ireland, from Being a Burden on Their Parents or Country, and for Making Them Beneficial to the Publick† is one of the most popular and analyzed texts within the world of satire, and truly makes one think about the art. One article that explores Swift’s use of satire within â€Å"A Modest Pr oposal† is Paddy Bullord’s â€Å"The Scriblerian Mock-Arts† This essay delves deeply into Swift’s works, and the art of satire inRead MoreEssay about A Modest Proposal, by Jonathan Swift1165 Words   |  5 PagesIrony is a beautiful technique exercised to convey a message or call a certain group of people to action. This rhetorical skill is artfully used by Jonathan Swift in his pamphlet â€Å"A Modest Proposal.† The main argument for this bitingly ironic essay is to capture the attention of a disconnected and indifferent audience. Swift makes his point by stringing together a dreadfully twisted set of morally untenable positions in order to cast blame and aspersions on his intended audience. Jonathan Swift’sRead MoreA Modest Proposal Response846 Words   |  4 PagesModest Proposal Response Emily Pendyk Parsons AP English 11 December 18, 2011 Dear Mr. Smarmy: I am writing in response to your request of the elimination of Jonathan Swift’s â€Å"A Modest Proposal† from the classrooms, libraries, and the school system as a whole. Let me begin by telling you that I took what you said into deep consideration, but after discussing with the work with some of the English teachers at Martin’s Groves Junior High School and conducting research on my own time, it’s

Monday, May 11, 2020

Mike Analysis Mike s Iep Essay - 1233 Words

Mike appeared to be respectful of his peers and vice versa. After reading Mike’s IEP, I was surprised to learn that Mike has difficult in-group settings. Indeed, in my field observations I witness several instances where other students looked at Mike as a leader. I found students to be aware of what Mike was doing and admiring how Mike is able to stay focused on his work. Also, Mike was engaged in the classroom and asked questions in a simple and safe manner. Mike interacted well with both genders. For example, he was an attentive listeners and speaker when going over an assignment. He was the only boy white. As a result of my field observations and document analysis of Mike’s IEP, I am left wondering why Mike does not participate in more inclusive classroom. In fact, I believe the educational setting that is being given to Mike does not match what he needs to fulfill his full educational potential. I found Mike to be attentive and he did not appear to be a challenge in the classroom. This was evident in my observations of Mike during small group and independent time. I believe Mike behaved appropriately and was attentive to his surroundings. I found other students to lack both physical and common sense of awareness compared to Mike. Other things that I noticed and wonder about are the instructional practices and services being provided to Mike. For example, I noticed that the teacher’s lessons were predominantly teacher-centered and very little use of visual clues. IShow MoreRelatedThe Effects Of Music Therapy On Children With Autism Spectrum Disorder Essay2292 Words   |à ‚  10 Pagescommunication skills. (Raglio, Traficante, Oasi, 2011). Not only is this improvisation music therapy used to enhance autism patients, but other types of techniques are also used and combined with it. Sometimes in music therapy, Applied Behavioral Analysis (ABA) is combined with improvisational music therapy. A person who uses ABA on a child with autism sometimes may use certain aspects of music therapy. When it comes to language and the training program of ABA it sometimes uses songs to assess themRead MoreStabilisation in Investment Contracts and Changes of Rules in Host Countries: Tools for Oil Gas Investors34943 Words   |  140 Pagesattempted to address these issues by developing stabilisation mechanisms are considered. Finally, Part 4 presents some conclusions and recommendations, and offers some guidance with respect to ‘tools for oil and gas investors’ on the basis of the analysis presented in this study. *** I wish to thank the many AIPN members who have shared their ideas and materials with me in the course of carrying out this study. As is often the case with AIPN studies, this author has benefited from access

Wednesday, May 6, 2020

Community Work Service for Adult Offenders Free Essays

The focus is on Community work service as an alternative sentencing. Community work service allows the offender to contribute to the community. This type of work can be considered a win-win situation, because the offenders provide the service and the community benefits from their work. We will write a custom essay sample on Community Work Service for Adult Offenders or any similar topic only for you Order Now There are all kinds of work activities for offenders. The points that are going to be addressed are: community work service, probation officers, taxpayers, overcrowding and the benefits each party gains. It can be concluded that community work service is here to stay. Hence, it can be seen as a second chance to repair the damage done by making right out of wrong. Community service is when someone performs an action which benefits his or her community. However, community work service can be a form of alternative sentencing. The offender is ordered by a court or probation officer to perform community work service as part of a sanction. Through community service, offenders are offered the chance to â€Å"give back† to the community by providing a service that enriches the lives of others. The offenders are placed into unpaid community service positions with non-profit or tax supported community agencies† (Cook county, 2006). The probation officer carefully monitors the offender’s progress by checking with the agency, ensuring that the offenders is regularly reporting to complete the hours, as well as monitoring the offenders’ attitude and quality of work. The probation officer is also responsible for reporting any negative incidents to the court in an effort the hold the offender accountable. Community service is a form of restorative justice, which involves victim, offender, and community. Criminal justice is asset of institutions and procedures for determining which people deserve to be sanctioned because of their wrongdoing and what kind of sanctions they deserve to receive† (Clear, 2003). Community work service allows sentences to more closely fit the circumstances of certain offences, and ensures that adult offenders are held accountable to the community for their actions. Hence, alternative sentencing is, applied to offenders whose absence of prior criminal history or general characteristics indicates that they can be trusted not to abuse their greater freedom. Community work service is punishment that takes away an offenders time and energy† (Schmalleger, 2009). Restorative justice is the concept that any crime, regardless of size or severity, hurts the community. Instead of merely paying a fine or spending time in jail, the offender is able to repair some of the damage done by participating in community service. â€Å"There is a need to understand who or what is being restored, including the core values of healing, moral learning, community participation, community caring, respectful dialogue, forgiveness, responsibility, apology, and making amends† (Sieh, 2006). The work assignment gives both the community and workers a chance to benefit from the experience. All offenders participating in the program are supervised by personnel at the sponsoring agency and by probation officers. â€Å"within the community justice frame work, the need to establish enduring partnerships with citizenry, other agencies, and local interest groups is critical to the success of probation† (Sieh, 2006). There are all kinds of work activities for offenders. Examples of work placements include: * Agencies offering services to senior citizens or the handicapped * Hospitals * Highway cleanup Parks maintenance * Skilled labor (carpentry) * Landscaping * Painting During probation, offenders must stay out of trouble and meet various other requirements. Probation officers, who are called community supervision officers in some States, supervise people who have been placed on probation. â€Å"Probation officers supervise offenders on probation or parole through personal contact with the offenders and their families† (Schmalleger, 2009). Instead of requiring offenders to meet officers in their offices, many officers meet offenders in their homes and at their places of employment or therapy. Some offenders are required to wear an electronic device so that probation officers can monitor their location and movements. â€Å"Probation supervision has three main elements: resource mediation, surveillance, and enforcement† (Schmalleger, 2009). Probation officers may arrange for offenders to get substance abuse rehabilitation or job training. Probation officers usually work with either adults or juveniles exclusively. Only in small, usually rural, jurisdictions do probation officers counsel both adults and juveniles. Probation officers must be ware that they will not always be effective in helping probationers, making it necessary to find outside resources for the probationer to succeed† (Sieh, 2006). Probation officers also spend much of their time working for the courts. They investigate the backgrounds of the accused, write presentence reports, and recommend sentences. They review sentencing recommendations with offenders and their families before submitting them to the court. Probation officers may be required to testify in court as to their findings and recommendations. They also attend hearings to update the court on offenders’ efforts at rehabilitation and compliance with the terms of their sentences. The number of cases a probation officer or correctional treatment specialist handles at one time depends on the needs of offenders and the risks they pose. Higher risk offenders and those who need more counseling usually command more of the officer’s time and resources. Caseload size also varies by agency jurisdiction. Consequently, â€Å"officers may handle from 20 to more than 100 active cases at a time† (Sieh, 2006). Probationers perceive probation officers as agents who will assist them, while, judges are viewed as agents whose main purpose is to punish offenders for wrongdoing† (Sieh, 2006). When an offender is placed on community supervision by the court, he/she signs a â€Å"contract† whereby he/she agrees to abide by certain conditions. These conditions usually include: * Report to the probation officer * Do not commit any new crime * Do not use alcohol and / or drugs or enter bars * Do not leave the County or State * Perform community work service Pay restitution, fine, court fees and probation fees if ordered * Permit the supervisor to visit him/her at the home or elsewhere By having the offender do community work service the offender will realize that not only do most crimes have a direct victim, but, the community is a victim as well. Having an offender provide services to the community rather than going to jail is beneficial to the tax payers. The tax payers don’t have to worry about another person going to prison where it might be overcrowded. Because overcrowded prisons have been a major problem in our society. In 2006, 8 of the nation’s 25 largest jails were operating at over 100 percent of their rated capacity† (Schmalleger, 2009). Having community work service as an alternative helps ease things down between the taxpayers and the justice system when it comes to the question, who has to pay to keep the offender in prison. Overcrowding puts prisoners at significant risk. People living in crowded conditions are more likely to get sick, stay sick, and pass diseases on to others. They are more likely to experience mental health problems, particularly stress-related mental illnesses. They are more likely to develop aggression and frustration. (Schmalleger, 2009). Being forced into crowded conditions with other prisoners results in riots, abuse, and assault. The prison system struggles to keep up with disciplinary problems when it has minimal staff and outdated facilities. This often results in brutal abuse at the hands of guards and other prison personnel. Overcrowding also limits access to resources. This includes health care for prisoners. Prisoners have died due to lack of health access because a nurse or doctor is not available and it’s considered ‘unsafe’ to transfer a prisoner for medical care. Considering that rates of hepatitis, HIV, and numerous other chronic conditions are high in prisons, lack of access to routine health care is a serious issue† Schmalleger, 2009). Lack of access to medications or irregular access to medications puts prisoners with chronic illnesses at extreme risk. â€Å" If extreme enough, overcrowding can lead to a court order that necessitates early release of certain prisoners in order to bring jails into compliance with the Constitution† (Schmalleger, 2009). How to cite Community Work Service for Adult Offenders, Essay examples

Thursday, April 30, 2020

Matrices in Matlab Essay Example

Matrices in Matlab Paper Matrices in Matlab You can think of a matrix as being made up of 1 or more row vectors of equal length. Equivalently, you can think of a matrix of being made up of 1 or more column vectors of equal length. Consider, for example, the matrix ? ? 1 2 3 0 A = ? 5 ? 1 0 0 ? . 3 ? 2 5 0 One could say that the matrix A is made up of 3 rows of length 4. Equivalently, one could say that matrix A is made up of 4 columns of length 3. In either model, we have 3 rows and 4 columns. We will say that the dimensions of the matrix are 3-by-4, sometimes written 3 ? . We already know how to enter a matrix in Matlab: delimit each item in a row with a space or comma, and start a new row by ending a row with a semicolon. gt;gt; A=[1 2 3 0;5 -1 0 0;3 -2 5 0] A = 1 2 3 0 5 -1 0 0 3 -2 5 0 We can use Matlab’s size command to determine the dimensions of any matrix. gt;gt; size(A) ans = 3 4 That’s 3 rows and 4 columns! Indexing Indexing matrices in Matlab is similar to the indexing we saw with ve ctors. The di? erence is that there is another dimension 2. To access the element in row 2 column 3 of matrix A, enter this command. 1 2Copyrighted material. See: http://msenux. redwoods. edu/Math4Textbook/ We’ll see later that we can have more than two dimensions. 76 Chapter 2 Vectors and Matrices in Matlab gt;gt; A(2,3) ans = 0 This is indeed the element in row 2, column 3 of matrix A. You can access an entire row with Matlab’s colon operator. The command A(2,:) essentially means â€Å"row 2 every column† of matrix A. gt;gt; A(2,:) ans = 5 -1 0 0 Note that this is the second row of matrix A. Similarly, you can access any column of matrix A. The notation A(:,2) is pronounced â€Å"every row column 2† of matrix A. gt;gt; A(:,2) ans = 2 -1 -2 Note that this is the second column of matrix A. You can also extract a submatrix from the matrix A with indexing. Suppose, for example, that you would like to extract a submatrix using rows 1 and 3 and columns 2 and 4. gt;gt; A([1,3],[2,4]) ans = 2 0 -2 0 Study this carefully and determine if we’ve truly selected rows 1 and 3 and columns 2 and 4 of matrix A. It might help to repeat the contents of matrix A. Section 2. 2 Matrices in Matlab 77 gt;gt; A A = 1 5 3 2 -1 -2 3 0 5 0 0 0 You can assign a new value to an entry of matrix A. gt;gt; A(3,4)=12 A = 1 2 5 -1 3 -2 3 0 5 0 0 12 When you assign to a row, column, or submatrix of matrix A, you must replace the contents with a row, column, or submatrix of equal dimension. For example, this next command will assign new contents to the ? rst row of matrix A. gt;gt; A(1,:)=20:23 A = 20 21 22 5 -1 0 3 -2 5 23 0 12 There is an exception to this rule. If the right side contains a single number, then that number will be assigned to every entry of the submatrix on the left. For example, to make every entry in column 2 of matrix A equal to 11, try the following code. gt;gt; A(:,2)=11 A = 20 11 5 11 3 11 22 0 5 23 0 12 It’s interesting what hap pens (and very powerful) when you try to assign a value to an entry that has a row or column index larger than the corresponding dimension of the matrix. For example, try this command. 78 Chapter 2 Vectors and Matrices in Matlab gt;gt; A(5,5)=777 A = 20 11 5 11 3 11 0 0 0 0 22 0 5 0 0 23 0 12 0 0 0 0 0 0 777 Note that Matlab happily assigns 777 to row 5, column 5, expanding the dimensions of the matrix and padding the missing entries with zeros. gt;gt; size(A) ans = 5 5 The Transpose of a MatrixYou can take the transpose of a matrix in exactly the same way that you took the transpose of a row or column vector. For example, form a â€Å"magic† matrix with the following command. gt;gt; A=magic(4) A = 16 2 5 11 9 7 4 14 3 10 6 15 13 8 12 1 You can compute AT with the following command. gt;gt; A. ’ ans = 16 2 3 13 5 11 10 8 9 7 6 12 4 14 15 1 Section 2. 2 Matrices in Matlab 79 Note that the ? rst row of matrix AT was previously the ? rst column of matrix A. The second row of matrix AT was previously the second column of matrix A, and so on for the third and fourth columns of matrix AT . In essence, taking the transpose re? cts the matrix A across its main diagonal (upper left corner to lower right corner), so the rows of A become columns of AT and the columns of A become rows of AT . Building Matrices Matlab has some powerful capabilities for building new matrices out of one or more matrices and/or vectors. For example, start by building a 2 ? 3 matrix of ones. gt;gt; A=ones(2,3) A = 1 1 1 1 1 1 Now, build a new matrix with A as the ? rst column and A as the second column. As we are not starting a new row, we can use either space or commas to delimit the row entries. gt;gt; C=[A A] C = 1 1 1 1 1 1 1 1 1 1 1 1On the other hand, suppose that we want to build a new matrix with A as the ? rst row and A as the second row. To start a new row we must end the ? rst row with a semicolon. gt;gt; C=[A; A] C = 1 1 1 1 1 1 1 1 1 1 1 1 Let’s create a 2 ? 3 matrix of all zeros. 80 Chapter 2 Vectors and Matrices in Matlab gt;gt; D=zeros(2,3) D = 0 0 0 0 0 0 Now, let’s build a matrix out of the matrices A and D. gt;gt; E=[A D;D A] E = 1 1 1 1 0 0 0 0 1 1 0 0 0 0 1 1 0 0 1 1 0 0 1 1 The possibilities are endless, with one caveat. The dimensions must be correct or Matlab will report an error. For example, create a 2 ? 2 matrix of ones. gt;gt; A=ones(2,2) A = 1 1 1 1 And a 2 ? 3 matrix of zeros. gt;gt; B=zeros(2,3) B = 0 0 0 0 0 0 It’s possible to build a new matrix with A and B as row elements. gt;gt; C=[A B] C = 1 1 1 1 0 0 0 0 0 0 Section 2. 2 Matrices in Matlab 81 But it’s not possible to build a new matrix with A and B as column elements. gt;gt; C=[A;B] Error using ==gt; vertcat CAT arguments dimensions are not consistent. This happens because A has 2 columns, but B has 3 columns, so the columns don’t line up. We’ll see in later work that the matrix building capabilities of Matlab are a powerful ally . Scalar-Matrix MultiplicationIf asked to multiply a matrix by a scalar, one would hope that the operation of scalar-matrix multiplication would be carried out in exactly the same manner as scalar-vector multiplication. That is, simply multiply each entry of the matrix by the scalar. Example 1. If A is the matrix ? 1 2 3 A = 3? 4 5 6? , 7 8 9 ? perform the scalar-matrix multiplication 3A. Simply multiply 3 times each ? 1 3A = 3 ? 4 7 entry of the matrix. ? ? ? 2 3 3 6 9 5 6 ? = ? 12 15 18 ? 8 9 21 24 27 Matlab understands scalar-matrix multiplication. First, enter matrix A. gt;gt; A=[1 2 3;4 5 6;7 8 9] A = 1 2 3 4 5 6 7 8 9 Now compute 3A. 82 Chapter 2Vectors and Matrices in Matlab gt;gt; 3*A ans = 3 12 21 6 15 24 9 18 27 Matrix Addition If two matrices have the same dimension, then add the matrices by adding the corresponding entries in each matrix. Example 2. If A and B are the matrices ? ? ? ? 1 1 1 1 1 1 A = ? 2 2 2? and B = ? 1 1 1? , 3 3 3 1 1 1 ? nd the sum A + B. Simply add the corresponding entries. ? ? ? ? ? ? 1 1 1 1 1 1 2 2 2 A + B = ? 2 2 2? + ? 1 1 1? = ? 3 3 3?. 3 3 3 1 1 1 4 4 4 Matlab understands matrix addition. gt;gt; A=[1 1 1;2 2 2;3 3 3]; B=[1 1 1;1 1 1;1 1 1]; gt;gt; A+B ans = 2 2 2 3 3 3 4 4 4 This is identical to the hand-calculated sum above.Let’s look what happens when the dimensions are not the same. Example 3. If A and B are the matrices Section 2. 2 ? 1 1 1 A = ? 2 2 2? 3 3 3 ? then ? nd the sum A + B. Note the dimensions of each matrix. Matrices in Matlab 83 and B= 1 1 1 , 1 1 1 gt;gt; A=[1 1 1;2 2 2;3 3 3]; B=[1 1 1;1 1 1]; gt;gt; size(A) ans = 3 3 gt;gt; size(B) ans = 2 3 The matrices A and B do not have the same dimensions. Therfore, it is not possible to sum the two matrices. gt;gt; A+B Error using ==gt; plus Matrix dimensions must agree. This error message is completely expected. One ? nal example is in order. Example 4. If matrix A is ? 1 1 1 A = ? 2 2 2? 3 3 3 compute A + 1. Note that this addition of a matrix and a scalar makes no sense. ? ? 1 1 1 A + 1 = ? 2 2 2? + 1 3 3 3 ? 84 Chapter 2 Vectors and Matrices in Matlab The dimensions are all wrong. However, this is such a common occurrence in algebraic calculations (as we will see throughout the course), Matlab allows this matrix-scalar addition. gt;gt; A=[1 1 1;2 2 2;3 3 3]; gt;gt; A+1 ans = 2 2 2 3 3 3 4 4 4 Matlab simply adds 1 to each entry of the matrix A. That is, Matlab interprets A + 1 as if it were the matrix addition of Example 2. Matrix addition enjoys several properties, which we will ask you to explore in the exercises. . Addition is commutative. That is, A + B = B + A for all matrices A and B having the same dimension. 2. Addition is associative. That is, (A + B) + C = A + (B + C), for all matrices A, B, and C having the same dimension. 3. The zero matrix is the additive identity. That is, if A is m ? n and 0 is an m ? n matrix of all zeros, then A + 0 = A. 4. Each matrix A has an additive inverse. Form the matrix ? A by negatin g each entry of the matrix A. Then, A + (? A) = 0. Matrix-Vector Multiplication Consider the linear system of three equations in three unknowns. 2x + 3y + 4z = 6 3x + 2y + 4z = 8 5x ? 3y + 8x = 1. 2. 1) Because each of the corresponding entries are equal, the following 3 ? 1 vectors are also equal. ? ? ? ? 2x + 3y + 4z 6 ? 3x + 2y + 4z ? = ? 8 ? 5x ? 3y + 8x 1 Section 2. 2 Matrices in Matlab 85 The left-hand vector can be written as a vector sum. ? ? ? ? ? ? ? ? 2x 3y 4z 6 ? 3x ? + ? 2y ? + ? 4z ? = ? 8 ? 5x ? 3y 8z 1 Scalar multiplication can be used to factor the variable out of each vector on the left-hand side. ? ? ? ? ? ? ? ? 2 3 4 6 x? 3? + y? 2 ? + z? 4? = ? 8? (2. 2) 5 ? 3 8 1 The construct on the left-hand side of this result is so important that we will pause to make a de? nition.Definition 5. Let ? 1 , ? 2 , . . . , and ? n be scalars and let v1 , v2 , . . . , and vn be vectors. Then the construction ? 1 v1 + ? 2 v2 +  ·  ·  · + ? n vn is called a linear combination of the vectors v1 , v2 , . . . , and vn . The scalars ? 1 , ? 2 , . . . , and ? n are called the weights of the linear combination. For example, we say that ? ? ? ? ? ? 2 3 4 ? 3? + y? 2 ? + z? 4? x 5 ? 3 8 is a linear combination of the vectors [2, 3, 5]T , [3, 2, ? 3]T , and [4, 4, 8]T . 3 Finally, we take one last additional step and write the system (2. 2) in the form ? ? ? ? 2 3 4 x 6 ? 3 2 4 y ? = ? 8?. (2. 3) 5 ? 8 z 1 Note that the system (2. 3) has the form Ax = b, where 3 Here we use the transpose operator to save a bit of space in the document. 86 Chapter 2 ? Vectors and Matrices in Matlab ? ? x ? y ? , x= z ? ? 6 ? 8?. b= 1 ? 2 3 4 A = ? 3 2 4? , 5 ? 3 8 and The matrix A in (2. 3) is called the coe? cient matrix. If you compare the coe? cient matrix in (2. 3) with the original system (2. 1), you see that the entries of the coe? cient matrix are simply the coe? cients of x, y, and z in (2. 1). On right-hand side of system (2. 3), the vector b = [6, 8, 1]T contains the n umbers on the right-hand side of the original system (2. ). Thus, it is a simple matter to transform a system of equations into a matrix equation. However, it is even more important to compare the left-hand sides of system (2. 2) and system (2. 3), noting that ? ? ? ? ? ? ? ? 2 3 4 x 2 3 4 ? 3 2 4 y ? = x? 3? + y? 2 ? + z? 4?. 5 ? 3 8 z 5 ? 3 8 This tells us how to multiply a matrix and a vector. One takes a linear combination of the columns of the matrix, using the entries in the vector as weights for the linear combination. Let’s look at an example of matrix-vector multiplication Example 6. Multiply the matrix and vector ? ? 1 2 ? 3 1 ? 3 0 4 ? ? ? 2 ? . 0 ? 2 3 To perform the multiplication, take a linear combination of the columns of the matrix, using the entries in the vector as weights. ? ? ? ? ? ? ? ? 1 2 ? 3 1 1 2 ? 3 ? 3 0 4 ? ? ? 2 ? = 1 ? 3 ? ? 2 ? 0 ? + 3 ? 4 ? 0 ? 2 2 3 0 ? 2 2 ? ? ? ? ? ? 1 ? 4 ? 9 ? 3 ? + ? 0 ? + ? 12 ? = 0 4 6 ? ? ? 12 ? 15 ? = 10 Itâ€℠¢s important to note that this answer has the same number of entries as does each column of the matrix. Section 2. 2 Matrices in Matlab 87 Let’s see if Matlab understands this form of matrix-vector multiplication. First, load the matrix and the vector. gt;gt; A=[1 2 -3;3 0 4;0 -2 2]; x=[1; -2; 3]; Now perform the multiplication. gt;gt; A*x ans = -12 15 10 Note this is identical to our hand calculated result. Let’s look at another example. Example 7. Multiply Ax, where A= 1 1 1 2 0 ? 2 and x = 1 . 1 If you try to perform the matrix-vector by taking a linear combination using the entries of the vectors as weights, Ax = 1 1 1 2 0 ? 2 1 1 1 1 =1 +1 +? . 1 2 0 ? 2 (2. 4) The problem is clear. There are not enough weights in the vector to perform the linear combination. Let’s see if Matlab understands this â€Å"weighty† problem. gt;gt; A=[1 1 1;2 0 -2]; x=[1; 1]; gt;gt; A*x Error using ==gt; mtimes Inner matrix dimensions must agree.Inner dimensions? Let†™s see if we can intuit what that means. In our example, matrix A has dimensions 2 ? 3 and vector x has dimensions 2 ? 1. If we juxtapose these dimensions in the form (2? 3)(2? 1), then the inner dimensions don’t match. 88 Chapter 2 Vectors and Matrices in Matlab Dimension Requirement. If matrix A has dimensions m ? n and vector x has dimensions n ? 1, then we say â€Å"the innner dimensions match,† and the matrix-vector product Ax is possible. In words, the number of columns of matrix A must equal the number of rows of vector x. Matrix-Matrix Multiplication We would like to extend our de? ition of matrix-vector multiplication in order to ? nd the product of matrices. Here is the needed de? nition. Definition 8. Let A and B be matrices and let b1 , b2 , . . . , and bn represent the columns of matrix B. Then, AB = A b1 , b2 , . . . , bn = Ab1 , Ab2 , . . . , Abn . Thus, to take the product of matrices A and B, simply multiply matrix A times each vector column of matri x B. Let’s look at an example. Example 9. Multiply 1 2 3 4 1 ? 2 . 2 1 We multiply the ? rst matrix times each column of the second matrix, then use linear combinations to perform the matrix-vector multiplications. 1 2 3 4 1 ? = 2 1 = 1 = 1 2 3 4 1 , 2 1 2 3 4 ? 2 1 1 2 1 2 +2 , ? 2 +1 3 4 3 4 5 0 11 ? 2 Let’s see if Matlab understands this form of matrix-matrix multiplication. First, load the matrices A and B. gt;gt; A=[1 2;3 4]; B=[1 -2;2 1]; Now, multiply. Section 2. 2 Matrices in Matlab 89 gt;gt; A*B ans = 5 11 0 -2 Note that this result is indentical to our hand calculation. Again, the inner dimensions must match or the matrix-matrix multiplication is not possible. Let’s look at an example where things go wrong. Example 10. Multiply 1 1 1 2 0 ? 2 1 2 . 3 4 When we multiply the ? rst matrix times each column of the second matrix, we immediately see di? ulty with the dimensions. 1 1 1 2 0 ? 2 1 2 = 3 4 1 1 1 2 0 ? 2 1 , 3 1 1 1 2 0 ? 2 2 4 (2. 5) In the ? rst column of the matrix product, the matrix-vector multiplication is not possible. The number of columns of the matrix does not match the number of entries in the vector. Therefore, it is not possible to form the product of these two matrices. Let’s see if Matlab understands this dimension di? culty. gt;gt; A=[1 1 1;2 0 -2]; B=[1 2;3 4]; gt;gt; A*B Error using ==gt; mtimes Inner matrix dimensions must agree. The error message is precisely the one we would expect. Dimension Requirement.If matrix A has dimensions m ? n and matrix B has dimensions n ? p, then we say â€Å"the inner dimensions match,† and the matrix-matrix product AB is possible. In words, the number of columns of matrix A must equal the number of rows of matrix B. Let’s look at another example. 90 Chapter 2 Vectors and Matrices in Matlab Example 11. Multiply ? 1 2 1 1 1 ? AB = 1 ? 2 ? . 2 0 ? 2 2 0 Load the matrices A nd B into Matlab and check their dimensions. gt;gt; A=[1 1 1;2 0 -2]; B=[1 2;1 -2; 2 0]; gt;gt; size(A) ans = 2 3 gt;gt; size(B) ans = 3 2 Thus, matrix A has dimensions 2 ? 3 and B has dimensions 3 ? . Therefore, the inner dimensions match (they both equal 3) and it is possible to form the product of A and B. gt;gt; C=A*B C = 4 -2 ? 0 4 Note the dimensions of the answer. gt;gt; size(C) ans = 2 2 Recall that A was 2 ? 3 and B was 3 ? 2. Note that the â€Å"outer dimensions† are 2 ? 2, which give the dimensions of the product. Dimensions of the Product. If matrix A is m ? n and matrix B is n ? p, then the dimensions of AB will be m ? p. We say that the â€Å"outer dimensions give the dimension of the product. † Section 2. 2 Matrices in Matlab 91 Properties of Matrix MultiplicationMatrix multiplication is associative. That is, for any matrices A, B, and C, providing the dimensions are right, (AB)C = A(BC). Let’s look at an example. Example 12. Given A= 2 2 , 3 3 B= 1 1 , 2 5 and C = 3 3 , 2 5 use Matlab to demonstrate that (AB)C = A(BC). Load the matrices A, B, and C into Matlab, then calculate the left-hand side of (AB)C = A(BC). gt;gt; A=[2 2;3 3]; B=[1 1;2 5]; C=[3 3;2 5]; gt;gt; (A*B)*C ans = 42 78 63 117 Next, calculate the right-hand side of (AB)C = A(BC). gt;gt; A*(B*C) ans = 42 78 63 117 Hence, (AB)C = A(BC). Matrix Multiplication is Associative.In general, if A, B, and C have dimensions so that the multiplications are possible, matrix multiplication is associative. That is, it is always the case that (AB)C = A(BC). 92 Chapter 2 Vectors and Matrices in Matlab Unfortunately, matrix multiplication is not commutative. That is, even if A and B are of correct dimensions, it is possible that AB = BA. Let’s look at an example. Example 13. Let A= 1 2 3 4 and B = 3 5 . 2 7 Do the matrices A and B commute? That is, does AB = BA? Load the matrices into Matlab, then compute AB. gt;gt; A=[1 2;3 4]; B=[3 5;2 7]; gt;gt; A*B ans = 7 19 17 43 Now compute BA. gt;gt; B*A ans = 18 23 6 32 Thus, AB = BA. Matrix Multiplication is not Commutative. In general, even if the dimensions of A and B allow us to reverse the order of multiplication, matrices A and B will not commute. That is, AB = BA. Any change in the order of multiplication of matrices will probably change the answer. Some matrices do commute, making this even more complicated. Section 2. 2 Matrices in Matlab 93 gt;gt; A=[5 3;7 4],B=[-4 3;7 -5]; gt;gt; A*B ans = 1 0 0 1 gt;gt; B*A ans = 1 0 0 1 In this case, AB = BA. However, in general, matrix multiplication is not commutative. The loss of the commutative property is not to be taken lightly.Any time you change the order of multiplication, you are risking an incorrect answer. There are many insidious ways that changes of order can creep into our calculations. For example, if you multiply the left-hand side of equation on the left by a matrix A, then multiply the right-hand side of the equation on the right by the same matrix A, you’ve changed the order and should expect an incorrect answer. W e will explore how the loss of the commutative property can adversely a? ect other familiar algebraic properties in the exercises. Here is a list of matrix properties you can depend on working all of the time.Let A and B be matrices of the correct dimension so that the additions and multiplications that follow are possible. Let ? and ? be scalars. A(B + C) = AB + AC (A + B)C = AC + BC. (? + ? )A = ? A + ? A ? (A + B) = ? A + ? B. ?(? A) = ( )A. (? A)B = ?(AB) = A(? B). For example, as stated above, matrix multiplication is distributive over addition. That is, A(B + C) = AB + AC. gt;gt; A=[2 3;-1 4]; B=[1 2;0 9]; C=[-3 2;4 4]; gt;gt; A*(B+C) ans = 8 47 18 48 gt;gt; A*B+A*C ans = 8 47 18 48 94 Chapter 2 Vectors and Matrices in Matlab We will explore the remaining properties in the exercises. Section 2. 2 Matrices in Matlab 95 2. Exercises 1. Given the matrices A= and C= 3 1 , 5 8 3 3 , 2 1 B= 1 1 , 2 3 and C= 1 2 , 0 9 3. Given the matrices A= 1 0 , 2 5 B= 0 1 , 2 7 use Matlab to veri fy each of the following properties. Note that 0 represents the zero matrix. a) A + B = B + A b) (A + B) + C = A + (B + C) c) A + 0 = A d) A + (? A) = 0 use Matlab to verify each of the following forms of the distributive property. a) A(B + C) = AB + AC b) (A + B)C = AC + BC 4. Given the matrices A= 2 2 , 4 7 B= 3 1 , 8 9 2. The fact that matrix multiplication is not commutative is a huge loss. For example, with real numbers, the following familiar algeraic properties hold. . = ii. (a + b)2 = a2 + 2ab + b2 iii. (a + b)(a ? b) = a2 ? b2 Use Matlab and the matrices A= 1 1 4 2 and B = 2 3 1 6 (ab)2 a2 b2 and the scalars ? = 2 and ? = ? 3, use Matlab to verify each of the following properties. a) (? + ? )A = ? A + ? A b) ? (A + B) = ? A + ? B c) ? (? A) = ( )A d) (? A)B = ? (AB) = A(? B) 5. Enter the matrices A=pascal(3) and B=magic(3). a) Use Matlab to compute (A+B)T . b) Use Matlab to compute AT + B T and compare your result with the result from part (a). Explain what your learned in this exercise. to show that none of these properties is valid for these choices of A and B.Can you explain why each of properties (i-iii) is not valid for matrix multiplication? Hint: Try to expand the left-hand side of each property to arrive at the right-hand side. 96 Chapter 2 Vectors and Matrices in Matlab a) What is the result of the Matlab command A(:,2)=[ ]? Note: [ ] is the empty matrix. b) Refresh matrix A with A=pascal(4). What is the result of the Matlab command A(3,:)=[ ]? 13. Enter the matrix A=pascal(5). a) What command will add a row of all ones to the bottom of matrix A? Use Matlab to verify your conjecture. b) What command will add a column of all ones to the right end of matrix A?Use Matlab to verify your conjecture. 14. Enter the matrix A=magic(3). Execute the command A(5,4)=0. Explain the resulting matrix. 15. Enter the matrix A=ones(5). a) Explain how you can insert a row of all 5’s betwen rows 2 and 3 of matrix A. Use Matlab to verify your conjecure. b) Explain how you can insert a column of all 5’s betwen columns 3 and 4 of matrix A. Use Matlab to verify your conjecure. 16. Enter the matrix ? ? 1 2 3 A = ? 4 5 6?. 7 8 9 a) What is the output of the Matlab command A=A([1,3,2],:)? 6. Enter the matrix A=pascal(4) and the scalar ? = 5. a) Use Matlab to compute (? A)T . b) Use Matlab to compute ?A and compare your result with the result from part (a). Explain what your learned in this exercise. 7. Using hand calculations only, calculate the following matrix-vector product, then verify your result in Matlab. ? ? 1 1 2 1 ? 3 4 0 2 ? 0 5 6 ? 5 8. Write the following system of linear equations in matrix-vector form. 2x + 2y + 3z = ? 3 4x + 2y ? 8z = 12 3x + 2y + 5z = 10 9. Using hand calculations only, calculate the following matrix-matrix product, then verify your result in Matlab. ? ? 2 3 1 1 1 4 ? 0 1 2 0 0 5? 0 0 5 3 5 2 10. Enter the matrix magic(8). What Matlab command will zero out all of the even rows?Use Matlab to verify your conjecture. 11. Enter the matrix pascal(8). What Matlab command will zero out all of the odd columns? Use Matlab to verify your conjecture. 12. Enter the matrix A=pascal(4). Section 2. 2 b) Refresh matrix A to its original value. What Matlab command will swap columns 1 and 3 of matrix A? Use Matlab to verify your conjecture. 17. Enter the matrix ? ? 1 2 3 A = ? 4 5 6?. 7 8 9 a) Enter the Matlab command A(2,:)=A(2,:)-4*A(1,:)? Explain the result of this command. b) Continue with the resulting matrix A from part (a). What is the output of the Matlab command A(3,:)=A(3,:)-7*A(1,:)?Explain the result of this command. 18. Type format rat to change the display to rational format. Create a 3 ? 3 Hilbert matrix with the command H=hilb(3). a) What is the output of the Matlab command H(1,:)=6*H(:,1)? Explain the result of this command. b) Continue with the resulting matrix H from part (a). What command will clear the fractions from row 2 of this result? 19. Enter the matrices A=magic(3) and B=pascal(3). Execute the command C=A+i*B. Note: You may have to enter clear i to return i to its default (the square root of ? 1). a) What is the transpose of the matrix C? Use Matlab to verify your Matrices in Matlab 97 esponse. b) What is the conjugate transpose of the matrix C? Use Matlab to verify your response. 20. Use Matlab’s hadamard(n) command to form Hadarmard matrices of order n = 2, 4, 8, and 16. In each case, use Matlab to calculate H T H. Note the pattern. Explain in your own words what would happen if your formed the matrix product H T H, where H is a Hadamard matrix of order 256. 21. Enter the Matlab command magic(n) to form a â€Å"magic† matrix of order n = 8. Use Matlab’s sum command to sum both the columns and the rows of your â€Å"magic† matrix. Type help sum to learn how to use the syntax sum(X,dim) to accomplish this goal.What is â€Å"magic† about this matrix? 22. Enter the Matlab command A=magic(n) to form a â€Å"mag ic† matrix of order n = 8. Use Matlab’s sum command to sum the columns of your â€Å"magic† matrix. Explain how you can use matrix-vector multilication to sum the columns of matrix A. 23. Set A=pascal(5) and then set I=eye(5), then ? nd the matrix product AI. Why is I called the identity matrix? Describe what a 256 ? 256 identity matrix would look like. 24. Set A=pascal(4) and then set B=magic(4). What operation will produce the second column of the matrix product AB? Can this be done 98 Chapter 2 Vectors and Matrices in Matlab 28.Enter the Matlab command hankel(x) to form a Hankel matrix H, where x is the vector [1, 2, 3, 4]. The help ? le for the hankel commands describes the Hankel matrix as a symmetric matrix. Take the transpose of H. Describe what is mean by a symmetric matrix. 29. A Hilbert matrix H is de? ned by H(i, j) = 1/(i + j ? 1), where i ranges from 1 to the number of rows and j ranges from 1 to the number of columns. Use this de? nition and hand ca lculations to ? nd a Hilbert matrix of dimension 4 ? 4. Use format rat and Matlab’s hilb command to check your result. 30. The number of ways to choose k objects from a set of n objects is de? ed and calcualted with the formula n k = n! . k! (n ? k)! without ? nding the product AB? 25. Set the vector v=(1:5). ’ and the vector w=(2:6). ’. a) The product vT w is called an inner product because of the position of the transpose operator. Use Matalb to compute the inner product of the vectors v and w. b) The product vwT is called an outer product because of the position of the transpose operator. Use Matalb to compute the outer product of the vectors v and w. 26. Enter A=[0. 2 0. 6;0. 8 0. 4]. Calculate An for n = 2, 3, 4, 5, etc. Does this sequence of matrices converge? If so, to what approximate matrix do they converge? 7. Use Matlab ones command to create the matrices ? ? 2 2 2 1 1 A= , B = ? 2 2 2? , 1 1 2 2 2 and 3 3 . 3 3 Craft a Matlab command that will build the block diagonal matrix ? ? A 0 0 C = ? 0 B 0 ? , 0 0 C where the zeros in this matrix represent matrices of zeros of the appropriate size. De? ne a Pascal matrix P with the formula P (i, j) = i+j? 2 , i? 1 where i ranges from 1 to the number of rows and j ranges from 1 to the number of columns. Use this de? nition and hand calculations to ? nd a Pascal matrix of dimension 4 ? 4. Use Matlab’s pascal command to check your result. Section 2. 2 Matrices in Matlab 99 2. 2 Answers 1. ) Enter the matrices. gt;gt; A=[3 3;2 1]; B=[1 1;2 3]; Calculate A + B. gt;gt; A+B ans = 4 4 gt;gt; A+(B+C) ans = 7 5 9 12 c) Enter the matrix A and the zero matrix. gt;gt; A=[3 3;2 1]; O=zeros(2,2); 4 4 Calculate A + 0. gt;gt; A+O ans = 3 2 Calculate A. gt;gt; A A = 3 2 3 1 Calculate B + A. gt;gt; B+A ans = 4 4 3 1 4 4 b) Enter the matrices gt;gt; A=[3 3;2 1]; B=[1 1;2 3]; gt;gt; C=[3 1;5 8]; Calculate (A + B)C. gt;gt; (A+B)+C ans = 7 5 9 12 Calculate AC + BC. d) Enter the matrix A and the zero mat rix. startMatlab gt;gt; A=[3 3;2 1]; O=zeros(2,2); Calculate A + (? A). 100 Chapter 2 Vectors and Matrices in Matlab gt;gt; A+(-A) ans = 0 0 0 0 Calculate the zero matrix. gt;gt; O O = 0 0 0 0 5. gt;gt; (A+B)*C ans = 1 11 4 116 gt;gt; A*C+B*C ans = 1 11 4 116 a) Ener the matrices A and B. gt;gt; A=pascal(3); B=magic(3); Compute (A + B)T . 3. a) Enter the matrices A, B, and C. gt;gt; A=[1 0;2 5]; B=[0 1;2 7]; gt;gt; C=[1 2;0 9]; Compare A(B + C) and AB + AC. gt;gt; A*(B+C) ans = 1 3 12 86 gt;gt; A*B+A*C ans = 1 3 12 86 b) Enter the matrices A, B, and C. gt;gt; A=[1 0;2 5]; B=[0 1;2 7]; gt;gt; C=[1 2;0 9]; Compare (A+B)C and AC +BC. gt;gt; (A+B). ’ ans = 9 4 2 7 7 10 b) Compute AT + B T . gt;gt; A. ’+B. ’ ans = 9 4 2 7 7 10 12 8 5 12 8 The transpose of the sum of two matrices is equal to the sum of the transposes of the two matrices. 7. Enter matrix A and vector x. Section 2. 2 13. gt;gt; A=[1 1 2;3 4 0;0 5 6]; gt;gt; x=[1 2 5]. ’; Calculate Ax. gt;gt; A*x ans = 13 11 40 Matrices in Matlab 101 a) Enter the matrix A. gt;gt; A=pascal(5) To add a row of all ones to the bottom of the matrix, execute the following command. gt;gt; A(6,:)=ones(5,1) b) Enter the matrix A. gt;gt; A=pascal(5) To add a column of all ones to the right end of the matrix, execute the following command. gt;gt; A(:,6)=ones(5,1) 9. Enter matrices A and B. gt;gt; A=[2 3 1;0 1 2;0 0 5]; gt;gt; B=[1 1 4;0 0 5;3 5 2]; Calculate AB. gt;gt; A*B ans = 5 6 15 7 10 25 25 9 10 15. a) Enter the matrix A. 11. Enter matrix A. gt;gt; A=pascal(8); The following command will zero out all the odd columns. gt;gt; A(:,1:2:end)=0; gt;gt; A=ones(5); We’ll build a new matrix using the ? rst two roes of matrix A, then a row of 5’s, then the last three rows of matrix A. Note that we separate new columns with commas. 102 Chapter 2 Vectors and Matrices in Matlab gt;gt; B=[A(1:2,:);5*ones(1,5); A(3:5,:)] B = 1 1 1 1 1 1 1 1 1 1 5 5 5 5 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 b) Enter the matrix A. gt;gt; A=ones(5); We’ll build a new matrix using the ? rst 3 columns of matrix A, then a column of 5’s, then the last two columns of matrix A. Note that we separate new rows with semicolons. gt;gt; B=[A(:,1:3),5*ones(5,1), A(:,4:5)] B = 1 1 1 5 1 1 1 1 1 5 1 1 1 1 1 5 1 1 1 1 1 5 1 1 1 1 1 5 1 1 gt;gt; A=[1 2 3;4 5 6;7 8 9] A = 1 2 3 4 5 6 7 8 9 The next command will subtract 4 times row 1 from row 2. gt;gt; A(2,:)=A(2,:)-4*A(1,:) A = 1 2 3 0 -3 -6 7 8 9 b) Continuing with the last value of matrix A, the next command will subtract 7 times row 1 from row 3. gt;gt; A(3,:)=A(3,:)-7*A(1,:) A = 1 2 3 0 -3 -6 0 -6 -12 9. a) Enter the matrices A and B and compute C. gt;gt; A=magic(3); B=pascal(3); gt;gt; C=A+i*B The transpose of ? ? 8+i 1+i 6+i C = ? 3 + 1 5 + 2i 7 + 3i ? 4 + i 9 + 3i 2 + 6i 17. a) Enter the matrix A. Section 2. 2 is 8+i 3+i 4+i ? 1 + i 5 + 2i 9 + 3i ? . C = 6 + i 7 + 3i 2 + 6i T Matrices in Matlab 103 ? ? second dimension with the following command . You’ll note that the sum of each row is 260. gt;gt; sum(A,2) ans = 260 260 260 260 260 260 260 260 This result is veri? ed with the following Matlab command. gt;gt; C. ’ b) The conjugate ? 8+i ? 3 + 1 C= 4+i is 8? i 3? i 4? i ? 1 ? i 5 ? 2i 9 ? 3i ? . C = 6 ? 7 ? 3i 2 ? 6i T transpose of ? 1+i 6+i 5 + 2i 7 + 3i ? 9 + 3i 2 + 6i ? ? 23. Store A with the following command. gt;gt; A=pascal(5) A = 1 1 1 1 2 3 1 3 6 1 4 10 1 5 15 This result is veri? ed with the following Matlab command. gt;gt; C’ 1 4 10 20 35 1 5 15 35 70 21. Enter matrix A. gt;gt; A=magic(8) You sum the rows along the ? rst dimension with the following command. You’ll note that the sum of each column is 260. gt;gt; sum(A,1) You sum the columns along the You store I with the following command. gt;gt; I=eye(5) I = 1 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 Note that AI is identical to matrix A. 04 Chapter 2 Vectors and Matrices in Matlab You should be able to compute vwT manually and g et the same result. gt;gt; A*I ans = 1 1 1 1 1 1 2 3 4 5 1 3 6 10 15 1 4 10 20 35 1 5 15 35 70 27. Load the matrices A and B. gt;gt; A=ones(2); B=2*ones(3); Load the matrix C. gt;gt; C=3*ones(2);You can construct the required matrix with the following command. gt;gt; D=[A,zeros(2,3),zeros(2,2); zeros(3,2), B, zeros(3,2); zeros(2,2), zeros(2,3), C] A 256? 256 identity matrix would have 1’s on its main diagonal and zeros in all other entries. 25. a) Store the vectors v and w. gt;gt; v=(1:5). ’; w=(2:6). ; The inner product vT w is computed as follows. gt;gt; v. ’*w ans = 70 You should be able to compute vT w manually and get the same result. b) The outer product vwT is computed as follows. gt;gt; v*w. ’ ans = 2 3 4 6 6 9 8 12 10 15 29. The entry in row 1 column 1 would be H(1, 1) = 1/(1 + 1 ? 1) = 1. The entry in row 1 column 2 would be H(1, 2) = 1/(1+2? 1) = 1/2. Continuing in this manner, we arrive at a 4 ? 4 Hilbert matrix. ? ? 1 1/2 1/3 1/4 ? 1/2 1/3 1/ 4 1/5 ? H=? ? 1/3 1/4 1/5 1/6 1/4 1/5 1/6 1/7 This result can be veri? ed by these commands. 4 8 12 16 20 5 10 15 20 25 6 12 18 24 30 gt;gt; format rat gt;gt; H=hilb(4)