text:
And on top of that you also have some samples of what you can get this year. You can prepare yourself with the previous years' question papers of University of Mumbai Free Online CBSE UGC NET, SET, SLET Guide Book in Library and Information Science is prepared by Badan Barman. o�W�L���p\�ܹ�D����n˾r�N���+?k�f[-��hic>�ʩ��o�/��y���3�n�b3*�{�� 28 0 obj << Sample Question Paper 349 Sample Question Paper Mathematics (211) Time : 3 Hours Maximum Marks : 100 Note :1. Each question carries one mark. It's crucial to always focus on results and quality, and we have all the content you need here. The University of Mumbai Semester 5 (TYBA) question papers are very hard to acquire, PRMO: RMO: INMO: PRMO 2019 Question Paper. /Filter /FlateDecode stream >> endobj Get Last Year Question Paper for Semester 5 (TYBA) and solved answers for practice in your board and university exams. actively push the boundaries in an amazing manner every time. it, nothing will stand in your way. Eastern Cape Department of Education exam papers 2018 2017 2016 2015 2014 2013 2012 2011 Accounting 2019 Paper 1 | Memo | Answer Book Paper 2 | Memo | (Answer book unavailable) This guide book and articles are published in print format by DVS Publishers, Guwahati and the purchase … To view the papers click on links. /Parent 16 0 R Certification certification@dbe.gov.za DU Previous Year Papers: Delhi University conducts various undergraduate, postgraduate, diploma and certification courses.Candidates preparing for these exams, must go through the Delhi University Prepvious year papers. We are here to help with that and we bring in front the tremendous /Font << /F16 6 0 R /F15 9 0 R /F17 12 0 R /F18 15 0 R >> Question Numbers (1–16) are Multiple Choice Questions. Thankfully we have all the University of Mumbai /Filter /FlateDecode Telangana Inter IPE 1st Year Model Papers Previous Years Question Papers 2020: Here we Provided TS Intermediate IPE March 1st Year expected Question Papers, Previous Question Papers for all subjects Telugu, sanskrit, English, Maths 1A, Maths 1B, Physics, Chemistry, Biology, Civics, Economics, Commerce for both English and Telugu Medium with Answers.Students can … ... -I ECONOMICS -PAPER -02 (MATHEMATICAL METHODS FOR ECONOMICS) (7067) B.A (HONS)-I ECONOMICS -PAPER -03 (STATISTICAL METHODS IN ECONOMICS) (7068) 2015: Sample Question Paper 349 Sample Question Paper Mathematics (211) Time : 3 Hours Maximum Marks : 100 Note :1. Question Papers here for you and you will be very impressed with the quality and experience being /Parent 16 0 R exam-mate is an exam preparation and exam builder tool, containing a bank of topical and yearly past papers. The University of Mumbai Semester 5 (TYBA) previous year question papers to prepare for the exams as practicing previous year question papers will boost your confidence in exam preparations. You xڍU�r�6}�W���$H0OU_��v�Q��4}�)(FË�K�}��f�i�B�݃ݳg�7g//T�P���,6��6��u���T�$[l���w���J�S�ekq��.�ï!�c�v�̕��Y,���Py��r+6W��� ĬW��|}{s{�f �� ���R�0�I\�4��$D�L�б{lʖ׉TZϼ/"�EY������z��i(k�p�ҩL�d�Lc�ǖ�7�Xm���+xՔ��b�l����r-΅��� ++�%�n��[�عG6�6��(ˀ�}��! ���ȋ��w����^_ش��PB.�)f�TT��l��Q\?������M����U�5�k1���d�� Q[��V�@��=�N���(��RI_�6��/���SJY���F�(���È#n����o� ��ܹ�Uw���*����Ă5��l�ƻ��3#HI�b�U�P�R�ꦣ�V%�$"�8�w|��g2�IM��w��/��D�k�=;"Ȏ���lϡ-Aku��H(B�Z�o~4�t;|��dj�Ժ�W�ɦ�P7���_�R�wy������Q\O0Hځ��HD���JM���v�GR��T�kw׻)���"�"�gAY"��B��n����?v��%���tJ�V�8�@��� ������/�����ݞ3��XA��)"�Q2|jd��Yg������u2�yH��&}��C�%L�I Here are all the past exam papers from November 2020 s��CF|�\�I��ү1ߌ�:;Oa�d'�=�׹���j6e@Y� �i The Ministry of Education (Namibia), in partnership with our stakeholders, are committed to providing all Namibian residents with equitable access to quality education programmes to develop the abilities of individuals to acquire the knowledge, understanding, skills, values and attitudes required throughout their lifetimes. NIOS Question Papers PDF For Class 10 & Class 12: Students who are in search of NIOS Question Papers for Class 10 and Class 12 can refer to this article.In this article, we will provide you with all the necessary information regarding NIOS Question Papers for Secondary and Senior Secondary Levels. Students can use it to access questions related to topics, while teachers can use the software during teaching and to make exam papers … For each question, four alternative choices are given, of which only one is correct. Course: B.A ECONOMICS Subject name: Paper VI – Optional (E) - Mathematical Economics Year: III Old Scheme Prior to 2005 Admns. impressive! >> All most you all know the importance of the previous year MA Economics old question papers. Answer Key to RMO 2019: INMO 2020 – Questions. >> endobj If you dont find a question paper, kindly write to us, Help us maintain new question papers on Shaalaa.com, so we can continue to help students, CBSE Previous Year Question Paper With Solution for Class 12 Arts, CBSE Previous Year Question Paper With Solution for Class 12 Commerce, CBSE Previous Year Question Paper With Solution for Class 12 Science, CBSE Previous Year Question Paper With Solution for Class 10, Maharashtra State Board Previous Year Question Paper With Solution for Class 12 Arts, Maharashtra State Board Previous Year Question Paper With Solution for Class 12 Commerce, Maharashtra State Board Previous Year Question Paper With Solution for Class 12 Science, Maharashtra State Board Previous Year Question Paper With Solution for Class 10, CISCE ICSE / ISC Board Previous Year Question Paper With Solution for Class 12 Arts, CISCE ICSE / ISC Board Previous Year Question Paper With Solution for Class 12 Commerce, CISCE ICSE / ISC Board Previous Year Question Paper With Solution for Class 12 Science, CISCE ICSE / ISC Board Previous Year Question Paper With Solution for Class 10, Mumbai university engineering question papers with solutions, BA Economics Semester 5 (TYBA) University of Mumbai. 18 0 obj << Here you will find CA Foundation Accounting question paper, Business Laws question paper, Business Mathematics question paper and Business Economics question papers. �Rp��\ڄF�&���SbNe��t��N���L@�(j����*� APSC CCE Previous Papers for both prelims and Mains Examination.The APSC Combined Competitive Examination Question Paper pdf is available here. The University of Mumbai B.A. pushing the boundaries to really take things to that next level in a clever manner. especially if you want to be Cambridge: Cambridge University Press (1983). -H-$\@3n���3���ֽ�Ӝӄ�o�4��j&���{�Ϯ�g;�Q�endstream If you are trying to prepare for the upcoming Matric Finals and looking to find some old papers to work through, then you came to the right place. India's Economic Development: National and Regional- Core course of BA Economics - (The question bank is the same for V semester 2011,2013( Indian Economy) and CUCBCSS 2014 Admn onwards) 1 0 obj << x��YY��6~ϯ�[% fx �R�)��Qh )h�F Question 1 What is the set of all allocations in the above example? To view the papers click on links. x��VKs�6��W�Θ�|sS�v2N;��iz�$��D"]����Ń!�3Ӟz!�X���o�n~�� 3B�b6��Q���3UpL���W��˶m2���y�3��;eFP�rc�n�*Էզ���o��F��p�!���:��1��Բ�Z� �c�Cfo�.���v�99��� �t��a��ں����[P�K���ڶ� �y� T��? can be incredibly impressive. Econ 11B - Mathematics for Economics - Exam One Grading & Answer Key. MatheMatical econoMics Practice ProbleMs and solutions Second Edition G. Stolyarov II, ASA, ACAS, MAAA, CPCU, ARe, ARC, API, AIS, AIE, AIAF . Mathematics. endobj ... -I ECONOMICS -PAPER -02 (MATHEMATICAL METHODS FOR ECONOMICS) (7067) B.A (HONS)-I ECONOMICS -PAPER -03 (STATISTICAL METHODS IN ECONOMICS) (7068) 2015: Question Numbers (1–16) are Multiple Choice Questions. It's all a matter of understanding the process and adapting to that to Question papers and Solutions of RMO, INMO and PRMO are listed below. >> endobj brought to the table every time. You Note: Here, I will present solve problems typical of those offered in a mathematical economics Don't hesitate and browse our website for the best Maharashtra state board Semester 5 (TYBA) question papers and Macro Economics I - Core course of BA Economics - (The question bank is the same for II semester 2011 Admn and V semester 2014 Admn onwards) 9. Answer Key to PRMO 2019: RMO Question Paper 2019. The Applicants of APSC CCE 2020 can find the direct link for APSC CCE Question Paper in the sections below. Develops time management skills of students if they familiar with syllabus and marking scheme. Macro Economics I - Core course of BA Economics - (The question bank is the same for II semester 2011 Admn and V semester 2014 Admn onwards) 9. Exam 2020-21 Question paper Free Download PDF is available in www.oldquestionpapers.net which has been provided by many students this question bank 2020-21 previous year paper is available for all the students FREE Download Last 10 Years Sample Model Papers … huge difference, and you get to full prepare for all of this at the highest possible level every time. Previous Year Question Papers Answer Solution Last 10 Years Entrance Exam Paper Free Download 2020-21. Delhi University Previous years MA Economics question papers are very rare to get in the internet. 1. Second Edition Published in July 2014 . CA Foundation Question Paper May 2018 – … 2017 ASC Exam Papers. qN��,�G׎{� gz���6d�$V\��v�Ė�0+r�NВ(# t��ՖX#u1���e��)l?�@��6�v��c���?^|t�2��{7��c��&3��c���1��4?� ����W��6l_��_�ZIʽĩC��z��g���rhTb��۲�����12N�)�ȴ�@�p^�#��#C�n��W��Y䲰3]u�ֵ����cF�#"�r��Ӥ UCSC Econ11B - Maths Methods for Economists Pt. /Type /Page (ECON & STATISTICS) Y2S1 TIME: 2 HOURS DAY/DATE: TUESDAY 27/7/2010 11.30 A.M. – 1.30 P.M. Econ11A - Problem Set 1. India's Economic Development: National and Regional- Core course of BA Economics - (The question bank is the same for V semester 2011,2013( Indian Economy) and CUCBCSS 2014 Admn onwards) 3 0 obj << Econ 11B - Mathematics for Economists Part II - Exam 2 Grading and Solutions. Certification certification@dbe.gov.za /ProcSet [ /PDF /Text ] stream INSTRUCTIONS Answer question One and any other two questions. levity and value you would expect from something like this. Practice them and get to well versed with the question asked in the exam and the difficulty level of the paper. Answer Key to PRMO 2019: RMO Question Paper 2019. zRÑ��R��ԁ�s0%��m�u/��kd�ˌ�F"#��b:�l݅�p� 䂻l�3DW�~1s��M�ݣmmV�7C^K��3#�AX����/i����u�S�I�qrįyG���� ���i���HU|8a؎�� z�ϊ���q�s�Eլ�U����n��G�wnc@Y�$K|�p�'�(U]0�A�ʸ���B\� � oA-�ϱ���x��+�i��8�eD��b����z�2. /Length 1127 /MediaBox [0 0 595.276 841.89] endobj >> Papers and the exam at the right level. National Office Address: 222 Struben Street, Pretoria Call Centre: 0800 202 933 | callcentre@dbe.gov.za Switchboard: 012 357 3000. !���zܺ�A�asU}*sj@��r��>��|xh���u"�c�i"����:t.�juo�;|�u�>:�� We encourage you to adapt to the process and in the end that Examination 2020 might seem overwhelming, but once you prepare yourself for >> need. It covers Cambridge IGCSE Past Papers, Edexcel International GCSE, Cambridge and Edexcel A Level and IAL along with their mark schemes. CBSE Last 10 Years Question Papers PDF from 2010 to 2020 for class 10 and 12 students are available for free download. They focus mostly on showing off the results and you can also receive some guidance in regards to In today’s post I have tried collecting some Previous Year Question Papers for the First Year Students of Economics Honors of University of Delhi. >> endobj the adjacent solutions. We put our full effort to bring all the previous year’s Delhi university MA Economics question papers. Each one of the Maharashtra state board Semester 5 (TYBA) question papers are designed to offer you all the help you that you need to follow. /Type /Page First Edition Published in March-April 2008 . Which is why you have to pay a lot of attention to everything and with the right MatheMatical econoMics Practice ProbleMs and solutions Second Edition G. Stolyarov II, ASA, ACAS, MAAA, CPCU, ARe, ARC, API, AIS, AIE, AIAF . We want to make it easy for you to prepare the University of Mumbai Question Question papers and Solutions of RMO, INMO and PRMO are listed below. State Eligibility Test (SET | SLET) Exam 2020 Question paper Free Download PDF is available in www.oldquestionpapers.net which has been provided by many students this State Eligibility Test question bank 2020 previous year paper is available for all the students FREE Download SET | SLET Last 10 Years Sample Model Papers with answer keys and solution. Shaalaa.com is a great source for Past years Question papers of all Subjects for Practice. [5 marks] Criteria: Grade 10; Entry 1 to 30 of the 60 matching your selection criteria: Page 1 of 2 : Document / Subject Grade ... Economics: Grade 10: 2012: English: NSC: Economics GR 10 Exemplar P2 2012: Economics: Grade 10: 2012: Afrikaans: NSC: Economics P1 GR 10 Exemplar P1 2012: Economics: Grade 10: 2012: Type: Paper VI – Optional (E) - Mathematical Economics File Type: .pdf Details: Paper VI – Optional (E) - Mathematical Economics March 2009 Question Paper - Type version Attachment: should you need more question papers and their memos please send us an email to ... mathematics n4 a b logax logb Note: Here, I will present solve problems typical of those offered in a mathematical economics Jamia Millia Islamia Previous Year Question Papers Pdf Download - Diploma, BA, MBA, MA, MSc, PGD, RCA, MSW, M.Sc, PGD, MTech Entrance Papers. PRMO: RMO: INMO: PRMO 2019 Question Paper. %PDF-1.4 $xc#�w�0��ɘ��?�d�a�&�Èr"Q�b����㢳�%k�K1\#��4Bc�Qp��R5��:l�R�WA��k�F��bI� ����$I�T��2�n��}諦N(�����B� \V\a���9�fK��ڱ��z|�'�ƹ>�7E@�9A8�n��)�1��xakpw�2p�E�6v�W��c����y��.���{� /Contents 19 0 R stream fully prepared for any challenges that might arise. Question 1 What is the set of all allocations in the above example? Shaalaa.com gives you the well arranged sets of previous years question papers , to study for your University of Mumbai Semester 5 (TYBA) Advanced Economic Theory. In today’s post I have tried collecting some Previous Year Question Papers for the First Year Students of Economics Honors of University of Delhi. It will Arrow, K. and Hann, F., General Competitive Analysis. /Resources 1 0 R ���VM��w~N��c��V]w��q���;��z�>���>���W�(O\훮��.��Ϗ�p���{�} Below you will find old final papers from 2020 for every language and subject in South Africa. 19 0 obj << /ProcSet [ /PDF /Text ] (a) Explain the importance of mathematical economics. National Office Address: 222 Struben Street, Pretoria Call Centre: 0800 202 933 | callcentre@dbe.gov.za Switchboard: 012 357 3000. 17 0 obj << /Filter /FlateDecode great results and solutions all the time. certainly help a lot and it will offer you a sense of value and quality while also being able to bring in We have created a question paper bank so that the students can download them and practice. At the end of the day, it can bring in rewarding benefits, and the value can be extremely Practicing BSc Question Papers with answer keys and solutions will help you improve your score in the exam. Academia.edu is a platform for academics to share research papers. ECON 230: MATHEMATICS FOR ECONOMISTS 1 STREAM: B.SC. Just try to take that into consideration and the payoff can be amazing Each question carries one mark. Examination 2020 is very detailed and it has a lot of questions and content p#�]�K]�����EH��+1w��Ҿ'�:� ��e�0��>�U�>�5�ۮuT�(P:9� ���D s�cH�11���p��葳� MATHEMATICAL ECONOMICS A. Neyman Fall 2006, Jerusalem ... Debreu, G., Mathematical Economics, Twenty papers of Gerard Debreu. /MediaBox [0 0 595.276 841.89] The Econ 11B - Problem Sets. every time. Paper 3 and Paper 4 are of objective types. After the Declaration of the CA Foundation Nov 2020 Exam Dates and Completion of your syllabus you can download the latest collection of CA Foundation Revision Test Paper Nov 20 (RTP), CA Foundation Mock Test Papers (MTP), CA Foundation Sample Papers, CA Foundation Previous examination paper, CA Foundation Question For practice PDF down below of all the … It covers the Syllabus, Solved Question papers of previous years or Answer Keys and sample or format of June and December Examination for paper 1, 2 and 3. Mathematics. about the question papers and online instant access: thank you for downloading the past exam paper and its memo, we hope it will be of help to you. You always need the best Semester 5 (TYBA) question papers of board examinations, but at the same time you Mathematical economics is the application of mathematical methods to represent theories and analyze problems in economics.By convention, these applied methods are beyond simple geometry, such as differential and integral calculus, difference and differential equations, matrix algebra, mathematical programming, and other computational methods. Eastern Cape Department of Education exam papers 2018 2017 2016 2015 2014 2013 2012 2011 Accounting 2019 Paper 1 | Memo | Answer Book Paper 2 | Memo | (Answer book unavailable) National Office Address: 222 Struben Street, Pretoria Call Centre: 0800 202 933 | callcentre@dbe.gov.za want to know the solutions too. University of Mumbai B.A. Grade 12 Past Matric Exam Papers and Memorandum 2019-2020 | grade 12 past papers 2019 | KZN, Mpumalanga, Limpopo, Gauteng, Free State, … The whole CPT examination is of 400 marks and every paper is for 100 marks respectively. Examination. K�A�:��} TkӻBlِ�4�_��cMm��/+���9��fF��݋W�X����͂P��$�9"L.�ֿ�#�\rm�w��ž-���KR|.�.l�T�q�˫w�NΒIj��� ��2��u�9 F���.lx&-��� U��n*Ǐ[�������\o0"Zķ?b���S~�F/� �aS-�\E�b�3�5SE"A����T�H�Q�3�p$��svG���⌠�ex8;�!�vhK����$�mV�'��p����9g�/�s ��!�x�ʢo+��!��Tӈ�UCn}��1�{)�8�6�� �M��"ȼ�A�����lF4@�S! Grade 12 Past Matric Exam Papers and Memorandum 2019-2020 | grade 12 past papers 2019 | KZN, Mpumalanga, Limpopo, Gauteng, Free State, Northwest, Western, Northern, Eastern Cape province First Edition Published in March-April 2008 . The pattern of the CA foundation question paper are mentioned hereunder:-CA Foundation examination contains four papers. /Contents 3 0 R Private institutions of Maha board also published STD-11 and STD-12 model question paper with practice guess paper along with mock test question paper through their web portals and leading newspaper educational pages, every student can download Maha Board 11th & 12th Question Paper 2021 and model set or mock test suggestions for paper-1 and paper-2 … It is a known fact that with proper planning and putting efforts in the right direction will help you ace the upcoming exams. L�BA�UB���<������9/;. Second Edition Published in July 2014 . Previous Year Question Papers for University of Mumbai Semester 5 (TYBA) indicate the nature of the questions that can be asked in the upcoming exams. Here’s why: Practicing with the question papers of BSc helps you understand the BSc exam pattern i.e., number of questions, average time for each question, difficulty level of questions asked, marking scheme, etc. approach you can easily do that. For each question, four alternative choices are given, of which only one is correct. Arrow, K. and Hann, F., General Competitive Analysis. CA Foundation Question Paper Pattern. Thankfully the Semester 5 (TYBA) question papers of board examinations can really make a MATHEMATICAL ECONOMICS A. Neyman Fall 2006, Jerusalem ... Debreu, G., Mathematical Economics, Twenty papers of Gerard Debreu. �|"m�U}�+�o��ڮ���� y�fC*'�S� 6��F���/���ǆ���n�6J}�����Ó�֩DS��0H���'уz�A��e�C����"�A��3-05�c3�-��5������]Ӯb:�y�C]�8�$Ę �R͈x/�8��J��K�q�/�b^��y�1(���x2%� 00�:^�.���Lt�:ٜ0�\$�f��ΎM�Q Do not write on the question paper. Download University of Mumbai previous year question papers Semester 5 (TYBA) PDFs with solutions for BA Economics . Marking schemes released by University of Mumbai are quite helpful to know the perfect way to include key point in your answers and write the perfect exam to score optimum marks. It certainly helps a lot, it brings a sense of value and levity while also /Length 974 Answer Key to RMO 2019: INMO 2020 – Questions. suit your requirements. how everything can be completed. It's a great opportunity and one that can Sitemap. Download Question Papers of CA Foundation Course. Cambridge: Cambridge University Press (1983). 2 0 obj << /Length 1818 %�����ֆ�v��7g�endstream Paper 1 and Paper 2 are of subjective types. /Resources 17 0 R /Font << /F15 9 0 R /F18 15 0 R /F17 12 0 R /F22 22 0 R /F25 25 0 R >> Academic Support: Past Exam Papers.
Kid-friendly Zumba Songs, Central Mall Near Me, Central Plaza, Hong Kong, Antec Tricool 3-speed Fan, Graco High Chair Age, Open Grain Wood Refers To Wood That, General Physician Cv Sample, Diseases Of Maize, Kilik Frame Data,


text:
Public Group

# Trying to remove bullets and get 'java.util.ConcurrentModificationException'

This topic is 823 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I'm working on a game in Java, and in that game, when you fire a bullet and it goes off screen, it gets removed from the arraylist.

The problem is, when you fire a lot at once and they're all traveling off screen, I get a java.util.ConcurrentModificationException and the game crashes.

Note: I'm using the 'Rectangle' in java for my bullets so I could implement collision detection with ease.

I've tried everything so far.

Here's how I remove them:

for(Iterator<Bullet> iterator = bullet.iterator(); iterator.hasNext();) {

testBullet = iterator.next();

if(testBullet.rectangleBullet.x > (screen size is here) {

iterator.remove();

}

if(testBullet.rectangleBullet.x < 0) {

iterator.remove();

}

}

Quick note: This isn't copy and pasted, so the formatting may be a little weird.

Thanks!

##### Share on other sites

Java just pisses me off with this kind of stuff.  I know that the internet says calling remove should work, and yet I've had this same problem.

1. You are allowed to only call remove() once, so maybe it's being called twice for one iteration.  That seems unlikely

2. Some other thread is adding/removing stuff to the same list while you are iterating.

3. Just cheat to get it working, and figure it out later (what I end up doing)

ArrayList<Bullet> toRemove = new ArrayList<>();
for( Bullet bullet : bullets ) {
if( outOfBounds(bullet) )
}
bullets.removeAll(toRemove);

Someone try this with a little main method and see if the original works or throws an exception.  I don't have Java installed on my home machine now

##### Share on other sites
From the documentation:

The iterators returned by this class's iterator and listIterator methods are fail-fast: if the list is structurally modified at any time after the iterator is created, in any way except through the iterator's own remove or add methods, the iterator will throw a ConcurrentModificationException. Thus, in the face of concurrent modification, the iterator fails quickly and cleanly, rather than risking arbitrary, non-deterministic behavior at an undetermined time in the future.

So, it looks like it's actually possible to get this exception in a single-threaded app, if something is modifying the container from within the for loop. The code you posted doesn't appear to do that, but you also mention that you didn't copy and paste the exact code, and you didn't say that this was the whole code, so if there's more to your loop than what you've just posted, make sure it isn't adding more bullets from within that for loop!

If you're using Java 8, I believe you can just use an anonymous function and removeIf:

bullet.removeIf(b -> (b.rectangleBullet.x < 0 || b.rectangleBullet.x > screenSize));

Edited by Oberon_Command

##### Share on other sites

An alternative to GlassKnife's solution is to add the bullets you don't want to delete to the second ArrayList and just zap the rest from the original, then swap them out.

ArrayList<Bullet> bullets= new ArrayList<>();
ArrayList<Bullet> backBuffer = new ArrayList<>();
for( Bullet bullet : bullets ) {
if( !outOfBounds(bullet) )
}
bullets.clear();
ArrayList<Bullet> tmp = bullets;
bullets = backBuffer;
backBuffer = tmp;

This avoids all the shuffling of items that goes on under the hood when removing elements from an ArrayList.

##### Share on other sites

Java just pisses me off with this kind of stuff.  I know that the internet says calling remove should work, and yet I've had this same problem.

1. You are allowed to only call remove() once, so maybe it's being called twice for one iteration.  That seems unlikely

2. Some other thread is adding/removing stuff to the same list while you are iterating.

3. Just cheat to get it working, and figure it out later (what I end up doing)

ArrayList<Bullet> toRemove = new ArrayList<>();
for( Bullet bullet : bullets ) {
if( outOfBounds(bullet) )
}
bullets.removeAll(toRemove);

Someone try this with a little main method and see if the original works or throws an exception.  I don't have Java installed on my home machine now

I think I may have screwed up somewhere in my code and/or done something extremely stupid since the solution isn't working :P

I didn't think of that, though. It did seem to last a bit longer before throwing an exception, too.

EDIT: Wait, I may have figured it out. Will verify soon.

EDIT 2: Yup! Thanks for the little cheat, Glass_Knife! Works great.

Edited by null;

##### Share on other sites

I'd use Aldacron's method, it should be faster.

Actually, after looking at removeIf implementation, Oberon's method could be even faster.

1. GlassKnife's method does a first pass looking for elements, then a linear search through the array every time it needs to remove each element inside 'removeAll'.
2. Aldacron's method does a single pass, but it needs two "long lived" lists and copying the element's references around.
3. Oberon's does a single pass, and it only uses internally a short lived BitSet, which will probably be ruled out by escape analysis.

I'd go with 3 if Java 8 is available, otherwise with 2.

EDIT: Ohh dude, you're calling remove twice probably. Duh.

for(Iterator<Bullet> it = bullet.iterator(); it.hasNext(); bullet = it.next()) {
if(bullet.rectangleBullet.x > screenSize || bullet.rectangleBullet.x < 0) {
it.remove();
}
}

Doing two ifs separately there makes it so you'll be calling 'remove' twice for bullets that meet both conditions. That throws an error obviously since you can't remove the same element twice. So you should remove once if it meets any of the two conditions.

Edited by TheChubu

##### Share on other sites

EDIT: Ohh dude, you're calling remove twice probably. Duh.

for(Iterator<Bullet> it = bullet.iterator(); it.hasNext(); bullet = it.next()) {
if(bullet.rectangleBullet.x > screenSize || bullet.rectangleBullet.x < 0) {
it.remove();
}
}
[background=#fafbfc]Doing two ifs separately there makes it so you'll be calling 'remove' twice for bullets that meet both conditions. That throws an error obviously since you can't remove the same element twice. So you should remove once if it meets any of the two conditions.[/background]

Indeed, but you'd hope that screenSize is positive, which implies you never remove it twice in the original code. Your solution of course makes sure it works even for non-positive screen sizes :)

My guess is that the problem is elsewhere, it's just detected here. @OP: Maybe you call a function in this loop that also loops over the list? (EDIT: Or the other way around, a function that iterates over the list calls this function? Not sure that could cause this exception)

The above solution is much nicer, so use that rather than mine, but if you don't care about the order in the bullets list, and you don't want to create temporary lists, another solution is to move the last entry to the deleted spot, like
int last = bullets.size() - 1;  // Do yourself a favor, make lists a multiple rather than a singular word.

int i = 0;
while (i <= last) {
Bullet bullet = bullets.get(i); // So you can have singular bullets use the singular word.
if(bullet.rectangleBullet.x > screenSize || bullet.rectangleBullet.x < 0) {
if (i < last) { bullets.set(i, bullets.get(last)); }
last = last - 1;
// Do not increment i so the next iteration inspects the bullet we just moved here.
} else {
i = i + 1;
}
}

// Minor problem, bullets[last] is now the last bullet, but bullets.size() may be larger, and Java has no truncate-list operation.
// Instead, remove the last element repeatedly
int new_size = last + 1;
while (bullets.size() > new_size) { bullets.remove(bullets.size() - 1); }
Untested, so it may contain some typos.

As you can see, it's much longer and somewhat convoluted, but it's a possibility. Edited by Alberth

1. 1
2. 2
Rutin
22
3. 3
4. 4
frob
17
5. 5

• 9
• 33
• 13
• 13
• 10
• ### Forum Statistics

• Total Topics
632580
• Total Posts
3007189

×

format: plain


text:
Mathematical and Physical Journal
for High Schools
Issued by the MATFUND Foundation
 Already signed up? New to KöMaL?

Problem K. 318. (December 2011)

K. 318. Prove that if a, b, c, d are consecutive natural numbers, then d2 is a factor of the sum a+b2+c3.

(6 pont)

Deadline expired on January 10, 2012.

Sorry, the solution is available only in Hungarian. Google translation

Megoldás. Az első három szám legyen $\displaystyle d–3$, $\displaystyle d–2$, $\displaystyle d–1$. Ekkor az összeg: $\displaystyle d–3 + (d–2)^2 + (d–1)^3 = d – 3 + d^2 – 4d + 4 + d^3 – 3d^2 + 3d – 1 = d^3 – 2d^2 = d^2(d–2)$, azaz osztható $\displaystyle d$–vel.

Statistics:

 211 students sent a solution. 6 points: 139 students. 5 points: 17 students. 4 points: 14 students. 3 points: 9 students. 2 points: 6 students. 1 point: 5 students. 0 point: 5 students. Unfair, not evaluated: 16 solutions.

Problems in Mathematics of KöMaL, December 2011


text:
# zbMATH — the first resource for mathematics

##### Examples
 Geometry Search for the term Geometry in any field. Queries are case-independent. Funct* Wildcard queries are specified by * (e.g. functions, functorial, etc.). Otherwise the search is exact. "Topological group" Phrases (multi-words) should be set in "straight quotation marks". au: Bourbaki & ti: Algebra Search for author and title. The and-operator & is default and can be omitted. Chebyshev | Tschebyscheff The or-operator | allows to search for Chebyshev or Tschebyscheff. "Quasi* map*" py: 1989 The resulting documents have publication year 1989. so: Eur* J* Mat* Soc* cc: 14 Search for publications in a particular source with a Mathematics Subject Classification code (cc) in 14. "Partial diff* eq*" ! elliptic The not-operator ! eliminates all results containing the word elliptic. dt: b & au: Hilbert The document type is set to books; alternatively: j for journal articles, a for book articles. py: 2000-2015 cc: (94A | 11T) Number ranges are accepted. Terms can be grouped within (parentheses). la: chinese Find documents in a given language. ISO 639-1 language codes can also be used.

##### Operators
 a & b logic and a | b logic or !ab logic not abc* right wildcard "ab c" phrase (ab c) parentheses
##### Fields
 any anywhere an internal document identifier au author, editor ai internal author identifier ti title la language so source ab review, abstract py publication year rv reviewer cc MSC code ut uncontrolled term dt document type (j: journal article; b: book; a: book article)
On the stability of quadratic functional equations. (English) Zbl 1146.39045
Summary: Let $X,Y$ be vector spaces and $k$ a fixed positive integer. It is shown that a mapping $f(kx+y)+f(kx-y)=2k^{2}f(x)+2f(y)$ for all $x,y\in X$ if and only if the mapping $f:X\rightarrow Y$ satisfies $f(x+y)+f(x-y)=2f(x)+2f(y)$ for all $x,y\in X$. Furthermore, the Hyers-Ulam-Rassias stability of the above functional equation in Banach spaces is proven.

##### MSC:
 39B82 Stability, separation, extension, and related topics 39B52 Functional equations for functions with more general domains and/or ranges
##### Keywords:
Hyers-Ulam-Rassias stability; Banach spaces
Full Text:
##### References:
 [1] S. M. Ulam, “Problems in Modern Mathematics,” p. xvii+150, John Wiley & Sons, New York, NY, USA, 1960. · Zbl 0137.24201 [2] D. H. Hyers, “On the stability of the linear functional equation,” Proceedings of the National Academy of Sciences of the United States of America, vol. 27, no. 4, pp. 222-224, 1941. · Zbl 0061.26403 · doi:10.1073/pnas.27.4.222 [3] T. Aoki, “On the stability of the linear transformation in Banach spaces,” Journal of the Mathematical Society of Japan, vol. 2, pp. 64-66, 1950. · Zbl 0040.35501 · doi:10.2969/jmsj/00210064 [4] Th. M. Rassias, “On the stability of the linear mapping in Banach spaces,” Proceedings of the American Mathematical Society, vol. 72, no. 2, pp. 297-300, 1978. · Zbl 0398.47040 · doi:10.2307/2042795 [5] Th. M. Rassias, “Problem 16; 2, Report of the 27th International Symposium on Functional Equations,” Aequationes Mathematicae, vol. 39, no. 2-3, pp. 292-293, 309, 1990. [6] Z. Gajda, “On stability of additive mappings,” International Journal of Mathematics and Mathematical Sciences, vol. 14, no. 3, pp. 431-434, 1991. · Zbl 0739.39013 · doi:10.1155/S016117129100056X · eudml:46657 [7] Th. M. Rassias and P. \vSemrl, “On the Hyers-Ulam stability of linear mappings,” Journal of Mathematical Analysis and Applications, vol. 173, no. 2, pp. 325-338, 1993. · Zbl 0789.46037 · doi:10.1006/jmaa.1993.1070 [8] J. M. Rassias, “On approximation of approximately linear mappings by linear mappings,” Bulletin des Sciences Mathématiques, vol. 108, no. 4, pp. 445-446, 1984. · Zbl 0599.47106 [9] F. Skof, “Local properties and approximation of operators,” Rendiconti del Seminario Matematico e Fisico di Milano, vol. 53, pp. 113-129, 1983. · Zbl 0599.39007 · doi:10.1007/BF02924890 [10] P. W. Cholewa, “Remarks on the stability of functional equations,” Aequationes Mathematicae, vol. 27, no. 1, pp. 76-86, 1984. · Zbl 0549.39006 · doi:10.1007/BF02192660 · eudml:137013 [11] St. Czerwik, “On the stability of the quadratic mapping in normed spaces,” Abhandlungen aus dem Mathematischen Seminar der Universität Hamburg, vol. 62, pp. 59-64, 1992. · Zbl 0779.39003 · doi:10.1007/BF02941618 [12] K.-W. Jun and Y.-H. Lee, “On the Hyers-Ulam-Rassias stability of a pexiderized quadratic inequality,” Mathematical Inequalities & Applications, vol. 4, no. 1, pp. 93-118, 2001. · Zbl 0976.39031 [13] S.-M. Jung, “On the Hyers-Ulam stability of the functional equations that have the quadratic property,” Journal of Mathematical Analysis and Applications, vol. 222, no. 1, pp. 126-137, 1998. · Zbl 0928.39013 · doi:10.1006/jmaa.1998.5916 [14] J. M. Rassias, “Solution of a quadratic stability Hyers-Ulam type problem,” Ricerche di Matematica, vol. 50, no. 1, pp. 9-17, 2001. · Zbl 1221.39039 [15] J. M. Rassias, “On approximation of approximately quadratic mappings by quadratic mappings,” Annales Mathematicae Silesianae, no. 15, pp. 67-78, 2001. · Zbl 1087.39518 [16] M. Mirzavaziri and M. S. Moslehian, “A fixed point approach to stability of a quadratic equation,” Bulletin of the Brazilian Mathematical Society, vol. 37, no. 3, pp. 361-376, 2006. · Zbl 1118.39015 · doi:10.1007/s00574-006-0016-z [17] Th. M. Rassias, “On the stability of the quadratic functional equation and its applications,” Studia Universitatis Babe\cs-Bolyai, vol. 43, no. 3, pp. 89-124, 1998. · Zbl 1009.39025


text:
1
AIEEE 2005
+4
-1
Area of the greatest rectangle that can be inscribed in the
ellipse $${{{x^2}} \over {{a^2}}} + {{{y^2}} \over {{b^2}}} = 1$$
A
$$2ab$$
B
$$ab$$
C
$$\sqrt {ab}$$
D
$${a \over b}$$
2
AIEEE 2005
+4
-1
The normal to the curve
$$x = a\left( {\cos \theta + \theta \sin \theta } \right),y = a\left( {\sin \theta - \theta \cos \theta } \right)$$ at any point
$$\theta\, '$$ is such that
A
it passes through the origin
B
it makes an angle $${\pi \over 2} + \theta$$ with the $$x$$-axis
C
it passes through $$\left( {a{\pi \over 2}, - a} \right)$$
D
it is at a constant distance from the origin
3
AIEEE 2005
+4
-1
A spherical iron ball $$10$$ cm in radius is coated with a layer of ice of uniform thickness that melts at a rate of $$50$$ cm$$^3$$ /min. When the thickness of ice is $$5$$ cm, then the rate at which the thickness of ice decreases is
A
$${1 \over {36\pi }}$$ cm/min
B
$${1 \over {18\pi }}$$ cm/min
C
$${1 \over {54\pi }}$$ cm/min
D
$${5 \over {6\pi }}$$ cm/min
4
AIEEE 2005
+4
-1
If the equation $${a_n}{x^n} + {a_{n - 1}}{x^{n - 1}} + ........... + {a_1}x = 0$$
$${a_1} \ne 0,n \ge 2,$$ has a positive root $$x = \alpha$$, then the equation
$$n{a_n}{x^{n - 1}} + \left( {n - 1} \right){a_{n - 1}}{x^{n - 2}} + ........... + {a_1} = 0$$ has a positive root, which is
A
greater than $$\alpha$$
B
smaller than $$\alpha$$
C
greater than or equal to smaller than $$\alpha$$
D
equal to smaller than $$\alpha$$
JEE Main Subjects
Physics
Mechanics
Electricity
Optics
Modern Physics
Chemistry
Physical Chemistry
Inorganic Chemistry
Organic Chemistry
Mathematics
Algebra
Trigonometry
Coordinate Geometry
Calculus
EXAM MAP
Joint Entrance Examination


text:
# [✓] Replace AppendTo with usage of Reap Sow?

GROUPS:
 I have tried to figure out how to use Reap and Sow from searching online, but do not understand it. Can anyone help me with my line of code? The issue is that the data set is so large that it takes a very long time to compute.I currently have a list that has just over 623,000 elements in it. My code to then loop through the list to determine the VertexDegree and then store those elements in a new list is: s35vertlist = {}; Do[AppendTo[s35vertlist, VertexDegree[Subgraph[s35, cyclelists35[[i]]]]], {i, Length[cyclelists35]}] Where s35vertlist is my new empty list, and cyclelists35 is my list with the large number of elements in it. I have tried s35vertlist = {}; s35vertlist = Reap[Do[Sow[s35vertlist, VertexDegree[Subgraph[s35, cyclelists35[[i]]]]], {i, Length[cyclelists35]}]] But it returns Null when I know that it should have least one element. So, I am hoping that someone can quickly tell me how to get Reap/Sow to work instead of AppendTo. I am sorry if this is super simple and annoying, but I can't figure it out. Thank you so much.
6 months ago
4 Replies
 Kuba Podkalicki 2 Votes You don't need Sow/Reap here: s35vertlist = Table[VertexDegree[Subgraph[s35, cyclelists35[[i]]]], {i, Length[cyclelists35]}] should do, or s35vertlist = VertexDegree[Subgraph[s35, #]] & /@ cyclelists35 With respect to a functional style, maybe there is something graph specific which could make it even better but that is not my area.
6 months ago
 Neil Singer 2 Votes Justin,I would think that Map might be faster: s35vertlist = Map[VertexDegree[Subgraph[s35, #]] &, cyclelists35] Sow works like this -- you don't append to the list -- it just collects the values. I do not recommend this in your case because you want a value returned for every element in your cyclelist s35vertlist = Reap[Do[Sow[VertexDegree[Subgraph[s35, cyclelists35[[i]]]]], {i, Length[cyclelists35]}]] Try doing an AbsoluteTiming[] for your loop and the Map and post the times. I am guessing that the Map is faster.Regards
6 months ago
 Neil Singer 1 Vote Sorry, Crossed with Kuda's post at the same time... I would also time Kuda's table approach to see if it is faster than the loop and/or the Map. Curious to know which is faster.(Also, if you compile the function you will probably get a significant speedup with any of the approaches)
6 months ago
 Wow. I am so glad I posted this question. All three solutions worked much faster than my original part. The first Table implementation took 65.9754. The second that uses some mapping code I don't understand took 64.1661. And the One that uses the Map function name took 63.4734! Thank you both for you help. I will try to read more about Table and Map since I didn't understand how to use them before.


text:
# What does the '•' mean in $(a(x,y, t) \cdot b(y,t))$

I'm working on statistics and have seen an equation that has a section like that shown above. $Max(_{y}\epsilon_{nbh(x)}) (a(x,y, t) \cdot b(y,t))$. I am unsure what the '•' means so the whole equation is confusing me.

Both a and b are functions. ngh returns the list of x's

Thanks

-
More information needed. Unless it means multiplication. –  GEdgar Feb 5 '13 at 15:48
The whole equation is : Max x Ɛ ngh(x) ((a(x,y,t)⋅b(y,t)). Sorry about the formatting. –  user1892574 Feb 5 '13 at 15:53
If $a$ and $b$ are functions with real values, then I think this is multiplication. –  GEdgar Feb 5 '13 at 16:03
If $a$ and $b$ are vectors, it's probably the scalar product. –  gnometorule Feb 5 '13 at 16:05
I've corrected the formula now. a and b are both functions that return real values; so i guess GEdgar is right. Thanks a lot for the help! –  user1892574 Feb 5 '13 at 16:10


text:
# The Full Disk Encryption Dilemma for Windows 10

I am quite unsatisfied with the current state of full disk encryption solutions available for use with Windows 10 on a Laptop with SSD. This blag post will mirror some of what [Bruce Schneier already said on the matter][Schneier2]: I will discuss some of the options and point out problems. I am not offering a solution, just a variety of bad choices to pick from. [Schneier2]: https://www.schneier.com/blog/archives/2015/06/encrypting_wind.html # Requirements For an optimal solution, I have the following requirements: 1. It should be implemented in software1. 2. The encryption should be open source, audited and deemed secure by a sufficiently large community of independent researchers. 3. Access to the encrypted drive should be as seamless as possible. # The Options Given this schedule of requirements, let us see where the different options fail. ## VeraCrypt [VeraCrypt] satsifies requirements 1 and 2 (in my opinion). However, their [FAQ] states clearly that you have to completely decrypt your hard drive before you can deploy one of those massive Windows 10 updates. Aside from being a downright agonizing way to spend 3 hours of your life, the process of decrypting, updating and re-encrypting might even leave unencrypted data on your hard drive (if you are using an SSD): A [lecture] from the [TI2] course of the ETH Zürich puts it quite succinctly: > SSDs contain more space than they tell the operating system. The extra space (called **space overhead**) gives engineers the possibility to optimize write overhead and wear leveling to an extent. The way I understand this, during decryption, sensible data could get written to a portion of the drive which is not even visible to VeraCrypt later. The only reliably secure solution to this dilemma would be to back up all sensible data from the system partition to an encrypted file container and deleting the files from the (encrypted) disk before decrypting and updating, then restoring them after the system drive has been encrypted again. A less fool-proof method would be to write random data to a file until disk space runs out and then deleting the file, several times, in the hope of eventually overwriting all possibly unencrypted parts of your SSD. So their failure to satisfy requirement 3 is so severe that it even puts a dent in requirement 2. ## BitLocker [BitLocker] is Microsoft's built-in full disk encryption solution. It satisfies requirements 1 and 3, but fails to meet the second. In particular if you rely on a TPM2 to store the encryption key (rather than your mind), [there is always the conceivable danger that certain third parties might have coerced the manufacturer of this _"trusted"_ device into providing a backdoor for them][Schneier1], which subverts the security of the system completely. #### Using Bitlocker without TPM If you distrust your trusted platform module, there is a way to make BitLocker use a password instead. Navigate to: - Group Policy Editor - Local Computer Policy - Computer Configuration - Administrative Templates - Windows Components - BitLocker Drive Encryption - Operating System Drives Here, enable the feature Require additional authentication at startup and set Configure TPM at startup to Do not allow TPM. In theory, this should give you the option to encrypt your system drive with BitLocker while using a password instead of the TPM. Note that I have only tested this on a virtual machine with no TPM device available. In the end however, the fact that BitLocker is not open source means that it can never fully satisfy the second requirement. ## DiskCryptor After becoming dissatisfied with [VeraCrypt] and not being convinced sufficiently by [BitLocker], I looked around and only found one other piece of software that seems applicable. Unfortunately, it seems that [DiskCryptor] has exactly [the same problem][DCUPDATE] as [VeraCrypt], so I did not even bother trying it out. [VeraCrypt]: https://www.veracrypt.fr/en/Home.html [FAQ]: https://www.veracrypt.fr/en/FAQ.html#SystemReinstallUpgrade [TI2]: https://disco.ethz.ch/courses/ti2/ [lecture]: https://disco.ethz.ch/courses/ti2/lecture/storage.pdf [BitLocker]: https://docs.microsoft.com/en-US/windows/device-security/bitlocker/bitlocker-overview [Schneier1]: https://www.schneier.com/blog/archives/2015/03/can_the_nsa_bre_1.html [DCUPDATE]: https://superuser.com/q/1011675/222330 [DiskCryptor]: https://diskcryptor.net/
1. Complex and critical system components in hardware have the catastrophic drawback that there is no straightforward and fast way to recover from a system malfunction. []
2. Trusted Platform Module []

## 2 Replies to “The Full Disk Encryption Dilemma for Windows 10”

1. I was just informed that there is [a script that supposedly solves the VeraCrypt dilemma](https://github.com/th-wilde/veracrypt-w10-patcher). I have not tried it.
2. Promising news: https://twitter.com/VeraCrypt_IDRIX/status/991239780351533063 Looks like the VeraCrypt now supports the Windows 10 Update process.


text:
# A Physical interpretation of Pauli-Lubanski pseudo-vector

1. Nov 10, 2016

### spaghetti3451

$P^{\mu}$ generates translations and extracts the four-momentum of a particle when it acts on the momentum eigenstate of a particle.

$J^{\mu\nu}$ generates rotations and measures the spin angular momentum along the $i$-direction of a particle when it acts on the $i$-th direction spin angular momentum eigenstate of a particle.

The Pauli-Lubanski psuedo-vector is given by $W_{\mu}=\frac{1}{2}\epsilon_{\mu\sigma\rho\tau}J^{\sigma\rho}P^{\tau}$ such that
$W_{\mu}|P,j,j_{z}\rangle = -mJ_{i}|P,j,j_{z}\rangle,$ where $|P,j,j_{z}\rangle$ is a momentum space eigenstate representing a particle of spin $j$ at rest with $P^{\mu}=(m,0,0,0)$ and $m\neq 0$.

What is the physical interpretation of $W_{\mu}$?

To prove that $[J_{\mu\nu},W^{2}]=0$, an explicit form of $[J_{\mu\nu},W_{\rho}]$ is necessary. One way to obtain $[J_{\mu\nu},W_{\rho}]$ is to define $I=\frac{i} {8}\epsilon_{\alpha\beta\gamma\delta}J^{\alpha\beta}J^{\gamma\delta}$ and show that $W_{\rho}=[I,P_{\rho}]$ and $[J_{\mu\nu},I]=0$.

What is an easy way to show that $[J_{\mu\nu},I]=0$ using the epsilon symbol in $I$?

$I$ is a scalar as all the indices are $0$, so why can not say that $[J_{\mu\nu},W^{2}]=0$ trivially?

2. Nov 11, 2016

### vanhees71

The Pauli Lubanski vector is pretty intuitive, when you familiarize yourself with Wigner's analysis of the irreducible unitary representations of the orthochronous proper Poincare group, the space-time symmetry group of special relativity. It provides the infinitesimal generators of the socalled little group associated with the representation. For details, see Appendix B of my lecture notes on QFT,

http://th.physik.uni-frankfurt.de/~hees/publ/lect.pdf


text:
# Tag Info

6

Just for fun: \documentclass[tikz]{standalone} \begin{document} \begin{tikzpicture} \gdef\shift{0} \foreach \x in {1,...,100}{ \pgfmathsetmacro\r{random(0,5)} \xdef\shift{\shift,\r} } \foreach \sh in {0,...,5}{ \gdef\rec{0} \foreach \s [count=\c] in \shift { \ifnum\s=\sh \xdef\rec{\rec,\c} \fi } \begin{scope} \clip ...

12

Procrastination team, represent! This is just too easy with TikZ ;-) Now with correct colors, correct font and the code matches the picture. You will need to use xelatex or lualatex to typeset. \documentclass{article} \pagestyle{empty} \usepackage{fontspec} \setmainfont{Calibri} \usepackage{tikz,xcolor,mwe} \definecolor{cvgreen}{HTML}{92D14F} ...

2

Like this? The arrows are centered wrt the entire node. I used a tabular inside \SB: \documentclass{article} \usepackage{tikz,xcolor, fontspec, schemata} \usetikzlibrary{shapes,arrows,positioning, decorations.pathreplacing} \setmainfont{Arial} \begin{document} \tikzset{block/.style={align=center}, line/.style = {draw,-latex',ultra thick}} ...

1

(don't vote I'll delete later but too long for a comment) I get no error. Add \listfiles and then check the file dates in the list shown at the end of your run. *File List* report.cls 2007/10/19 v1.4h Standard LaTeX document class size12.clo 2007/10/19 v1.4h Standard LaTeX file (size option) amssymb.sty 2013/01/14 v3.01 AMS font symbols ...

3

scrjura The package scrjura is intended for drafting legal documents according to German standards. The design of the package allows in general writing contracts, verdicts and even a special kind of books we call commentary ("Kommentar"). "In general" means that the basic structures have been written, but so far only the branch to write contracts has been ...

6

scrlfile Package scrlfile mostly gives powers to package authors, but a normal user can take advantage of this package as well. Suppose you want to run some code, but only if a special package is loaded. Or maybe you want to prevent to load this package after all. No problem. Feature overview scrlfile gives you the possibility to run code ...

14

scrextend This package makes basic features of KOMA-Script classes available for other classes, so it extends them. It is mainly meant for document writers, but could also be used by package and class writers. Description is found in main KOMA-Script documentation. As explicitly stated in documentation this package should not be used together with a ...

13

Package list (links behind package names lead to answers): scrbase scrdate and scrtime scrextend – makes some features of the KOMA-Script classes available for other classes. scrjura – contract environment for advocates and scholary persons in law scrlayer scrlayer-notecolumn scrlayer-scrpage as successor of legacy package scrpage2 (which has itself an ...

4

Ok, I took a look into Best practice on organising your preamble that @Mico recommended and it had exactly the same problem but hard to find. Additionally @David Carlisle explained that if a preamble gets too huge I can move the whole preamble to an sty file. While a lot of good pointers were made in the other post, after playing a while with the sty I can ...

2

I would try something like this: \documentclass[a4paper,oneside,12pt]{report} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% PACKAGES & SETTINGS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usepackage[english]{babel} % formatting rules for the English language \usepackage[T1]{fontenc} % proper formatting for ...

0

I need to run sudo tlmgr install ec in the terminal. It works fine now. Thanks for your comments.

4

balance.sty belongs to the preprint bundle. In Ubuntu and Debian Linux, the repository package texlive-latex-extra (see file list) contains the preprint bundle. So you can install it by sudo apt-get install texlive-latex-extra in a terminal window, or use your Ubuntu package manager for the installation. CTAN writes about it: preprint – A bundle of ...

4

You need neither adjustwidth nor hangparas: \documentclass[a4paper,11pt]{article} \usepackage{lipsum} \newenvironment{outpar} {\par\setlength{\parindent}{-0.25in}} {\par} \begin{document} \lipsum[1] \begin{outpar} \textbf{One.}\quad Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some ...

1

1

I did something similar for styles in graph theory. Assuming you're on a UNIX-based system (or on Windows with Cygwin/MinGW installed), you can use the install tool coupled with a lesser-known use of kpsewhich: SONI_DIR=kpsewhich -var-value TEXMFHOME/tex/latex/soni/ install -m 755 -d $SONI_DIR install -m 644 soni-er.sty$SONI_DIR Just stick all of ...

2

As the question is so open, this is my suggestion, using the bclogo package: \documentclass[twocolumn]{article} \usepackage{microtype} \usepackage{lipsum} % dummy text \usepackage[tikz]{bclogo} \newcommand\FancyBox[2]{% \begin{bclogo}[couleur=yellow!15!orange!05, logo=\Huge\bcplume, arrondi=0.3, ombre=true, couleurOmbre=gray, couleurBarre=orange!30, ...

1

Without anything fancy and with tabular: \documentclass{article} \usepackage{array} \newcolumntype{R}{p{\dimexpr0.88\textwidth-2\tabcolsep\relax}} \newcolumntype{L}{p{0.12\textwidth}} \newenvironment{play}[1][Player]{% \noindent\tabular{@{}L>{\raggedright\arraybackslash}R@{}} \textbf{#1:} &% }% {\endtabular}% \begin{document} \section{A section} ...

4

Probably tcolorbox can give you a start point... Code \documentclass{article} \usepackage{tcolorbox} \usepackage{lipsum} % just for the example \begin{document} \section{A section} \lipsum[1-3] \section{Fancy section} \begin{tcolorbox}[colback=yellow!50] \textbf{Player}: Hi! How are you? \end{tcolorbox} \begin{tcolorbox}[colback=green!50] ...

3

Mercurial This is a hack to say the least, but I can just as well show some code. I write the current revision and information on which files have been modified into drafts in the following way. I build the documents with Latexmk. In latexmkrc I add: require('scripts/writeLatexHgInfo.pl'); writeLatexHgInfo('.hginfo'); writeLatexHgInfo.pl contains: ...

6

You can "extract" only that symbol from MnSymbol and use it in your document. This is the code to extract \leftpitchfork: \DeclareFontFamily{U} {MnSymbolA}{} \DeclareFontShape{U}{MnSymbolA}{m}{n}{ <-6> MnSymbolA5 <6-7> MnSymbolA6 <7-8> MnSymbolA7 <8-9> MnSymbolA8 <9-10> MnSymbolA9 <10-12> MnSymbolA10 ...

1

I always end up loading the same packages, some of which were suggested by some answers to this question, such as hyperref, amsmath, nag, etoolbox, xparse, and others. I created a style file latexdev.sty that I use in almost all my notes and publications, which loads all these standard packages: https://github.com/olivierverdier/latexdev

12

Here's one possibility using the sidebar outer theme; the background canvas template was used to include the image in the background; the headline and frametitle templates were also redefined to take into account the width of the left image: \documentclass{beamer} \useoutertheme{sidebar} \makeatletter \setbeamertemplate{frametitle} {% ...

1

I include: \usepackage{outlines} in my preamble. outlines is a quick and easy way to generate hierarchically embedded lists. Especially useful when I'm drafting up a paper (I like to outline it) or if I'm quickly typing up notes, e.g., at a conference.

9

Note that I do not actually recommend you do the following. But, since you ask: You can force TeX/LaTeX to issue the directive \displaystyle automatically whenever you initiate inline-math mode -- via either an opening-\$ or a \( instruction -- by inserting the following command in your document's preamble: \everymath{\displaystyle} Again, I do not ...

5

Top 50 recent answers are included


text:
# Tag Info

4

In electrochemistry, the rate of electrolysis depends on rate of charge entering the cell. Second most important point is that one can either control potential or current but not both during electrolysis i.e. you cannot have both values set. If you are fixing potential at 2.5 V, the value of current is not in your hand. I don't think Ohm's law remains valid ...

3

For a general electrolytic reaction, $$\ce{M^{n+} + n e^- -> M}$$ where $n$ moles of electrons are consumed in depositing 1 mole of substance ($n$ is also known as $n$-factor). So, for $x$ moles of substance, $nx$ moles of electrons would be consumed. Therefore, $$Q = nxF,$$ dividing by $nF$ on both sides, we have $$\frac{Q}{nF} = x,$$ which is ...

1

The misconception you have in the question is that the concept of tabulated electrode potentials do not apply to molten salts. The values in general chemistry textbooks have been calculated in water under specific concentrations. No need to extrapolate electrode potentials to molten states.

Only top voted, non community-wiki answers of a minimum length are eligible


text:
# How to go about proving the basic operators in relational algebra are independent of each other?

The five basic operator select, project, cross, union and diff in relational algebra are independent of each other. I'm trying to formally prove this statement but can only progress for cross product as it would have columns greater than the rest which cannot be made possible by others. But can't think of anything for Select etc.

• Select: consider the relation $\{(1),(2)\}$.
• Union: consider the database $\{(1)\},\{(2)\}$ with identical attributes.
• Use mathematical induction. The point is that you can't get $\{(1)\}$ or $\{(2)\}$ without using select. – Yuval Filmus Sep 3 '12 at 14:19
• @Tegiri You're right that $\{(1)\}$ can be obtained via the difference of $\{(1),(2)\}$ and $\{(2),(3)\}$. Fortunately, there is no row $(3)$ anywhere in the database. – Yuval Filmus Sep 4 '12 at 21:15


text:
## Geometric representation of sequences of complexity $$2n+1$$. (Représentation géométrique de suites de complexité $$2n+1$$.)(French)Zbl 0789.28011

Let $$A$$ be a finite set and let $$\Omega= A^{\mathbb{N}}$$ be all of the one sided infinite sequences over $$A$$. For any $$u\in\Omega$$ and $$n\in\mathbb{N}$$ let $$L_ n(u)$$ be the set of subwords of $$u$$ of length $$n$$ ($$v\in A^ n$$ is a subword of $$u$$ if for some $$k$$ one has $$v_ 1= u_{k+1},\dots,v_ n= u_{k+n}$$), and let $$p_ n(u)$$ be the cardinality of $$L_ n(u)$$. The sequence $$(p_ n(u))$$ is called the complexity of $$u$$. This paper studies minimal sequences $$u$$ in $$\Omega$$ of complexity $$n+1$$ and $$2n+1$$. The analysis uses the de Bruijn graph of $$L_ n(u)$$ (where two words $$u$$, $$v$$ are connected if for some $$a,b\in A$$ one has $$u= bw$$ and $$v= wa$$). It is shown how all minimal sequences $$u$$ of complexity $$p_ n(u)= n+1$$ can be described by infinite sequences consisting of two substitutions, and how this leads to (the well-known) isomorphism of the action of the shift on the closed orbit of $$u$$ with a rotation on the circle. For a class of the sequences of complexity $$p_ n(u)= 2n+1$$ satisfying a regularity condition on their de Bruijn graphs it is shown that these generate closed orbits which are isomorphic to interval exchange transformations with six intervals.

### MSC:

 28D05 Measure-preserving transformations 11K50 Metric theory of continued fractions
Full Text:

### References:

 [1] ARNOUX (P.) . Un exemple de semi-conjugaison entre un échange d’intervalles et une rotation sur le tore , Bull. Soc. Math. France, t. 116, 1986 , p. 489-500. Numdam | MR 91a:58138 | Zbl 0703.58045 · Zbl 0703.58045 [2] ARNOUX (P.) et YOCCOZ (J.C.) . Construction de difféomorphismes pseudo-Anosov , C.R.A.S., t. 292, 1981 , p. 75-78. MR 82b:57018 | Zbl 0478.58023 · Zbl 0478.58023 [3] ITO (S.) et KIMURA (M.) . On Rauzy fractal , prépublication. · Zbl 0734.28010 [4] KEANE (M.) . Interval exchange transformations , Math. Z., t. 141, 1975 , p. 25-31. Article | MR 50 #10207 | Zbl 0278.28010 · Zbl 0278.28010 [5] KRIEGER (W.) . On entropy and generators of measure-preserving transformations , Trans. Amer. Math. Soc., t. 149, 1970 , p. 453-464. MR 41 #3710 | Zbl 0204.07904 · Zbl 0204.07904 [6] RAUZY (G.) . Suites à termes dans un alphabet fini , Séminaire de théorie des nombres de Bordeaux, t. 25, 1983 , p. 1-16. Article | MR 85j:11088 | Zbl 0547.10048 · Zbl 0547.10048 [7] RAUZY (G.) . Nombres algébriques et substitutions , Bull. Soc. Math. France, t. 110, 1982 , p. 147-178. Numdam | MR 84h:10074 | Zbl 0522.10032 · Zbl 0522.10032 [8] RAUZY (G.) . Rotations sur les groupes, nombres algébriques et substitutions , prépublication. · Zbl 0726.11019
This reference list is based on information provided by the publisher or from digital mathematics libraries. Its items are heuristically matched to zbMATH identifiers and may contain data conversion errors. It attempts to reflect the references listed in the original paper as accurately as possible without claiming the completeness or perfect precision of the matching.


text:
Department of Pre-University Education, KarnatakaPUC Karnataka Science Class 11

The Heights of Mercury Surfaces in the Two Arms of the Manometer Shown in Figure Are 2 Cm and 8 Cm - Physics

The heights of mercury surfaces in the two arms of the manometer shown in figure are 2 cm and 8 cm.
Atmospheric pressure = 1.01 × 105 N−2. Find (a) the pressure of the gas in the cylinder and (b) the pressure of mercury at the bottom of the U tube.

Solution

(a) Given:
Height of the first arm, h1 = 8 cm
Height of the second arm, h2 = 2 cm
Density of mercury, ρHg = 13.6 gm/cc
Atmospheric pressure, pa = 1.01 × 105 N/m2 = 1.01 × 106 dyn/cm
Now,
Let pg be the pressure of the gas.
If we consider both limbs, then the pressure at the bottom of the tube will be the same.

According to the figure, we have:
pg + ρHg × h2 × g = Pa + ρHg × hg

=> Pg =Pa +ρHg × g(h1-h2)

=1.01 ×106+13.6 ×980 ×(8-2) dyn/cm2

=(1.01 ×106+13.6 ×980 ×6)dyn/cm2

= 1.09 × 105N/m2

(b) Pressure of the mercury at the bottom of the U-tube:

PHg =Pa + ρHg×h1×g

=1.01×106+13.6×8×980

=1.12×105N/m2

Is there an error in this question or solution?

APPEARS IN

HC Verma Class 11, 12 Concepts of Physics 1
Chapter 13 Fluid Mechanics
Q 2 | Page 273


text:
Contents

# Contents

## Definition

Given an Archimedean field $F$, an open interval $I \subseteq F$, a pointwise continuous function $f:C^0(I, F)$ is differentiable if the difference quotient has a limit approaching the diagonal

$isDifferentiable(f) := hasLimitApproachingDiagonal\left(\frac{f(x) - f(y)}{x - y}\right)$

Let us define the type of differentiable functions $D^1(I, F)$ on $I$ as the type of pointwise continuous functions that are differentiable.

$D^1(I, F) := \{f \in C^0(I, F) \vert isDifferentiable(f)\}$

The Newton–Leibniz operator or D operator $\tilde{D}: D^1(I, F) \to (I \to F)$ is a function from the type of differentiable functions $D^1(I, F)$ to the type of functions $I \to F$, and is pointwise defined as

$\tilde{D}(f) \coloneqq \lim_{(x, y) \to (x, x)} \frac{f(x) - f(y)}{x - y}$

for a differentiable function $f:D^1(I, F)$. For any differentiable function $f:D^1(I, F)$, the function $\tilde{D}(f)$ is called the derivative of $f$.

## Properties

These all follow from the algebraic limit theorems of the limit of a binary function approaching a diagonal.

### Constant function rule

Let $c:I \to F$ be a constant function. With constant functions the function $c:I \to F$ and the value of the function $c:F$ are usually written with the same symbol. For all constant functions $c:I \to F$,

$\tilde{D}(c) = \lim_{(x, y) \to (x, x)} \frac{c - c}{x - y}$
$\tilde{D}(c) = \lim_{(x, y) \to (x, x)} \frac{0}{x - y}$
$\tilde{D}(c) = \lim_{(x, y) \to (x, x)} 0$
$\tilde{D}(c) = 0$

### Identity function rule

Where $\frac{x}{x}$ is another notation for $x \cdot x^{-1}$

$\tilde{D}(id_F) = \lim_{(x, y) \to (x, x)} \frac{x - y}{x - y}$
$\tilde{D}(id_F) = 1$

### Linearity

For all elements $a \in F$ and $b \in F$ and functions $f:I \to F$ and $g:I \to F$,

$\tilde{D}(a \cdot f + b \cdot g) = \lim_{(x, y) \to (x, x)} \frac{(a \cdot f(x) + b \cdot g(x)) - (a \cdot f(y) + b \cdot g(y)}{x - y}$
$\tilde{D}(a \cdot f + b \cdot g) = \lim_{(x, y) \to (x, x)} \frac{(a \cdot f(x) - a \cdot f(y)) + (b \cdot g(x) - b \cdot g(y)}{x - y}$
$\tilde{D}(a \cdot f + b \cdot g) = \lim_{(x, y) \to (x, x)} \frac{(a \cdot (f(x) - f(y)) + (b \cdot (g(x) - g(y))}{x - y}$
$\tilde{D}(a \cdot f + b \cdot g) = \lim_{(x, y) \to (x, x)} \frac{a \cdot (f(x) - f(y)}{x - y} + \frac{b \cdot (g(x) - g(y)}{x - y}$
$\tilde{D}(a \cdot f + b \cdot g) = a \cdot \lim_{(x, y) \to (x, x)} \frac{(f(x) - f(y)}{x - y} + b \cdot \lim_{(x, y) \to (x, x)} \frac{(g(x) - g(y)}{x - y}$
$\tilde{D}(a \cdot f + b \cdot g) = a \cdot \tilde{D}(f) + b \cdot \tilde{D}(g)$

### Leibniz rule

For all functions $f:I \to F$ and $g:I \to F$,

$\tilde{D}(f \cdot g) = \lim_{(x, y) \to (x, x)} \frac{(f(x) \cdot g(x)) - (f(y) \cdot g(y)}{x - y}$
$\tilde{D}(f \cdot g) = \lim_{(x, y) \to (x, x)} \frac{(f(x) \cdot g(x)) - (f(x) \cdot g(y)) + (f(x) \cdot g(y)) - (f(y) \cdot g(y)}{x - y}$
$\tilde{D}(f \cdot g) = \lim_{(x, y) \to (x, x)} \frac{(f(x) \cdot (g(x) - g(y)) + ((f(x) - f(y)) \cdot g(y))}{x - y}$
$\tilde{D}(f \cdot g) = \lim_{(x, y) \to (x, x)} \frac{f(x) \cdot (g(x) - g(y)}{x - y} + \frac{(f(x) - f(y)) \cdot g(y)}{x - y}$
$\tilde{D}(f \cdot g) = f \cdot \left(\lim_{(x, y) \to (x, x)} \frac{g(x) - g(y)}{x - y}\right) + \left(\lim_{(x, y) \to (x, x)} \frac{f(x) - f(y)}{x - y}\right) \cdot g$
$\tilde{D}(f \cdot g) = f \cdot \tilde{D}(g) + \tilde{D}(f) \cdot g$

### Power rule

For all functions $f:I \to F$ and natural numbers $n \in \mathbf{N}$,

$\tilde{D}(f^n) = \lim_{(x, y) \to (x, x)} \frac{f(x)^n - f(y)^n}{x - y}$

We proceed by induction on the natural numbers. The base case $n = 0$: For all functions $f:I \to F$,

$\tilde{D}(f^0) = \lim_{(x, y) \to (x, x)} \frac{f(x)^0 - f(y)^0}{x - y}$
$\tilde{D}(f^0) = \lim_{(x, y) \to (x, x)} \frac{1 - 1}{x - y}$
$\tilde{D}(f^0) = \tilde{D}(1)$

Then the inductive case: For all functions $f:I \to F$ and natural numbers $n \in \mathbf{N}$,

$\tilde{D}(f^{n+1}) = \lim_{(x, y) \to (x, x)} \frac{f(x)^{n+1} - f(y)^{n+1}}{x - y}$
$\tilde{D}(f^{n+1}) = \lim_{(x, y) \to (x, x)} \frac{f(x) \cdot f(x)^{n} - f(y) \cdot f(y)^{n}}{x - y}$
$\tilde{D}(f^{n+1}) = \tilde{D}(f) \cdot f^n + \tilde{D}(f^n) \cdot f$
$\tilde{D}(f^{n+1}) = \sum_{n=0}^{n} \tilde{D}(f) \cdot f^n$


text:
# Training Models that have Zero Likelihood

davidbarber Dec 21, 2019 · 8 mins read

A popular class of models in machine learning is the so-called generative model class with deterministic outputs. These are currently used for example in the generation of realistic images. If we represent an image with the variable $x$, then these models generate an image by the following process:

1. Sample $z$ from a $Z$ dimensional Gaussian (multivariate-normal) distribution.

2. Use this $z$ as the input to a deep neural network $g_\theta(z)$ whose output is the image $x$.

Typically the dimension of the latent variable is chosen to be much lower than the observation variable $Z\ll X$. This enables one to learn a low-dimensional representation of high-dimensional observed data.

We can write this mathematically as a latent variable model producing a distribution $p(x)$ over images $x$, with

and $p(x\vert{}z)$ restricted to a deterministic distribution so that

where we write $p_\theta(x)$ to emphasise that the model depends on the parameters $\theta$ of the network. These models represent a rich class of distributions (thanks to the highly non-linear neural network) and are also easy to sample from (using the above procedure).

So what’s the catch? Given a set of training images, $x^1,\ldots,x^N$, the challenge is to learn the parameters $\theta$ of the network $g_\theta$.

Because the latent dimension $Z$ is lower than the observation dimension $X$, the model can only generate images in a $Z$ dimensional manifold within the $X$ dimensional image space, as depicted in the figure for a latent dimension $Z=2$ and observed dimension $X=3$. That means that only images that lie on this manifold will have non-zero probability density value. For an image $x^n$ from the training dataset, unless it lies exactly on the manifold, the likelihood of this image $p_\theta(x^n)$ will be zero. This means that typically the log likelihood of the dataset

is not well defined and standard gradient based training of $L(\theta)$ is not possible. This is a shame because (i) many standard training techniques are based on maximum likelihood and (ii) maximum likelihood is statistically efficient, meaning that no other training method can more accurately learn the model parameters $\theta$.

The inappropriateness of maximum likelihood as the training criterion for this class of models has inspired much recent work. For example the GAN objective and MMD objectives are well known approaches to training such models1. However, it is interesting to consider whether one can nevertheless modify the maximum likelihood criterion to make it applicable in this situation. The beauty of doing so is that we may then potentially use standard maximum likelihood style techniques (such as variational training approaches).

For concreteness, we consider the Kullback-Leibler Divergence divergence between distributions $p$ and $q$

Maximising the likelihood is equivalent to minimising the KL Divergence between the empirical data distribution

and the model $p_\theta(x)$, since

The fact that maximum likelihood training is not appropriate for deterministic output generative models is equivalent to the fact that the KL divergence (and its gradient) are not well defined for this class of model.

More generally, for distributions $p$ and $q$, the $f$-Divergence is defined as

where $f(x)$ is a convex function with $f(1)=0$. However, this divergence may not be defined if the supports (regions of non-zero probability) of $p$ and $q$ are different, since then the ratio $p(x)/q(x)$ can cause a division by zero. This is the situation when trying to define the likelihood for data that is not on the low dimensional manifold of our model.

The central issue we address therefore is how to convert a divergence which is not defined due to support mismatch into a well defined divergence.

From $q(x)$ and $p(x)$ we define new distributions $\tilde{q}(y)$ and $\tilde{p}(y)$ that have the same support. We define distributions

where $p(y{\mid}x)$ ‘spreads’ the mass of $p$ and $q$ and is chosen such that $\tilde{p}$ and $\tilde{q}$ have the same support.

Consider the extreme case of two delta distributions

for which $KL(p\vert q)$ is not well defined. Using a Gaussian spread distribution $p(y{\mid}x)={\mathcal{N}}(y;x,\sigma^2)$ with mean $x$ and variance $\sigma^2$ ensures that $\tilde{p}$ and $\tilde{q}$ have common support $\mathbb{R}$. Then

and

and the KL divergence between the two becomes

This divergence is well defined for all values of $\mu_p$ and $\mu_q$. Indeed, this divergence has the convenient property that $KL(\tilde{p}\vert \tilde{q})=0 \Rightarrow p=q$. If we consider $p$ to be our data distribution (a single datapoint at $\mu_p$) and $q$ our model $p_\theta$, we can now do a modified version of maximum likelihood training to fit $p_\theta$ to $p$ – instead of minimising $KL(p\vert p_\theta)$, we minimise $KL(\tilde{p}\vert \tilde{p}_\theta)$.

Note that, in general, we must spread both distributions $p$ and $q$ for the divergence between the spreaded distributions to be zero to imply that the original distributions are the same. In the context of maximum likelihood learning, spreading only one of these distributions will in general result in a biased estimator of the underlying model.

If we consider stationary spread distributions of the form $p(y\vert x)=K(y-x)$, for ‘kernel’ function $K(x)$. It is straightforward to show that if the kernel $K(x)$ has strictly positive Fourier Transform, then

Interestingly, this condition on the kernel is equivalent to the condition on the kernel in the MMD framework2, which is an alternative way to define a divergence between distributions. It is easy to show that the Gaussian distribution has strictly positive Fourier Transform and thus defines a valid spread divergence. Another useful spread distribution with this property is the Laplace distribution.

### Machine Learning Applications

and adjust the parameters $\theta$ to make the model fit the data distribution

Since maximum likelihood is not (in general) available for this class of models, we instead consider minimising the spread KL divergence using Gaussian spread noise

where the spreaded data distribution is

The objective is then simply an expectation over the log likelihood $\log \tilde{p}_\theta(y)$,

which is a standard generative model with a Gaussian output distribution. For this we may now use a variational training approach to form a lower bound on the quantity $\log \tilde{p}_\theta(y)$. The final objective just then requires evaluating the expectation of this bound, which can be easily approximated by sampling from the spreaded data distribution.

Overall, this is therefore a simple modification of standard Variational Autoencoder (VAE) training in which there is an additional outer loop sampling from the spreaded data distribution3.

In the figure below we show how we are able to fit a deep generative 4 layer convolutional network with deterministic output to the CelebA dataset of face images. Whilst this model cannot be trained using standard VAE approaches, using the spread divergence approach and sampling from the trained model gives images of the form below

Our aim isn’t to produce the most impressive face sampler, but rather to show how one can make a fairly simple modification of the standard training algorithm to cope with deterministic outputs.

In our paper3 we apply this method to show how to overcome well known problems in training deterministic Independent Components Analysis models using only a simple modification of the standard training algorithm. We also discuss how to learn the spread distribution and how this relates to other approaches such as MMD and GANs.

## Summary

A popular class of generative deep network models cannot be trained using standard classical machine learning approaches. However, by adding ‘noise’ to both the model and the data in an appropriate way, one can nevertheless define an appropriate objective that is amenable to standard machine learning training approaches.

### References

1. S. Mohamed and B. Lakshminarayanan. Learning in Implicit Generative Models. arxiv.org/abs/1610.03483, 2016.

2. A. Gretton et al. A Kernel Two-Sample Test. Journal of Machine Learning Research, 13. 2012.

3. M. Zhang, P. Hayes, T. Bird, R. Habib, D. Barber. Spread Divergence. arxiv.org/abs/1811.08968, 2018.  2

##### Written by davidbarber
David is the Director of the UCL Centre for Artificial Intelligence


text:
C: Output "tomorrow's date"

I'm a code golf novice, but I'm eager to give it a go.

My challenge is: Write the shortest program in C which takes in a date D as input and outputs the date D + 1 day

Rules:

• program must compile only with gcc progname.c -o progname So no compiler/makefile tricks (if there are any) - compiler warnings don't matter
• The input and output format must be day/month/year zero padding of single digit values does not matter: 1/3/1998 is equal to 01/03/1998
• It doesn't matter how you give the the program it's input date, it can be a program argument, scanf whatever. Output must be to stdout however
• February has 29 days when the year is divisible by 4
• No date validation necessary, i.e. assume the input is always a valid date.
• any integer year should be supported, i.e. INT_MIN -> INT_MAX

Shortest code length wins, and there are extra points for extra bastardised C.

My solution uses 126 123* 121 characters

Good luck

*s="%i/%i/%i",m,d;main(y){scanf(s,&d,&m,&y);printf(s,d,m,(d=d%((m>7^m&1)+27+(m-2?3:y%4?1:2))+1)-1?y:(m=m%12+1)-1?y:y+1);}

*because of an idea Gareth's code gave me

• February doesn't have 29 days when the year is divisible by 100 unless it is also divisible by 400. Or is your last rule there to simplify matters slightly? Aug 9 '11 at 19:16
• @Gareth I think so. Aug 9 '11 at 19:20
• @Gareth, yes it's a simplification. Aug 9 '11 at 19:20
• Code golf is usually open for all languages, except if the problem can only be solved in one language. Please lift the restriction on using C only. Aug 9 '11 at 19:21
• @FUZxxl "Usually"... Not this time :) Aug 9 '11 at 19:26

Okay, it's been a while since I wrote any C but I'll give it a go:

m,y,*q="%d/%d/%d";
main(d){
scanf(q,&d,&m,&y);
++d>30+(m+(m>7))%2-(m^2?0:2-!(y%4))?(m+=d=1)>12?y+=m=1:0:0;
printf(q,d,m,y);}

120 characters.
With a bit of formatting(not that it makes it any more readable any more...):

m,y,*q="%d/%d/%d";
main(d)
{
scanf(q,&d,&m,&y);
++d>30+(m+(m>7))%2-(m^2?0:2-!(y%4))?(m+=d=1)>12?y+=m=1:0:0;
printf(q,d,m,y);
}

The compiler throws out warnings like nobody's business, but it works.

I'm not sure I can get it any smaller than this now without stealing a couple of tricks from Griffin. With those tricks I can get to 116 characters:

m,y,*q="%d/%d/%d";
main(d){
scanf(q,&d,&m,&y);
printf(q,d,m,++d>30+(m>7^m&1)-(m^2?0:2-!(y%4))?(m+=d=1)>12?y+=m=1:y:y);}

• Looks good mate, I reckon you can replace those ifs for ternary operators, also there's some repetition there that you can take out. Aug 11 '11 at 21:18
• I'm not entirely sure how I'd use the ternary operator in this case. I've got no if else blocks. Aug 11 '11 at 22:03
• You can just put a 0 in the else part: if(x)b; becomes x?b:0; you save one character, might take some refactoring though Aug 11 '11 at 22:50
• @Griffin 125 characters. Do I get a prize? ;-) Aug 11 '11 at 23:21
• That's excellent! You get a upvote from me. Though you've given me an idea that got my code down to 123 characters. I'll post it up since I've stolen your idea of making the vars global so as to not define a type for them. Aug 11 '11 at 23:41

C, 112 chars

Many months late, but I just saw it and decided to improve it.
The leading * isn't needed for 32bit platforms (and some 64bit platforms), so it can perhaps be removed.

*s="%d/%d/%d";
main(y,m,d){
scanf(s,&d,&m,&y);
d++>29+(m-2?m+m/8&1:!(y%4)-2)?d=m++<12||(y+=m=1):0;
printf(s,d,m,y);
}

Lots of similarity to Gareth's solution, but honestly - I didn't look.
The only thing I did borrow was saving the format string in a variable (which is kind of obvious, but I missed it).

I do fix a problem with Gareth's solution - it relies on the evaluation order of printf parameters.

C (in a way), 97 71

I will lose fifty rep for this but it was necessary.

The actual rule violation is that it doesn't quite do INT_MIN..INT_MAX; the range instead seems to be 0..1410065407 (on 64-bit Ubuntu 11... I'm saying nothing about portability :P).

main(){system("read a;date -d@$((date -d$a +%s+86400)) +%m/%d/%Y");}

(old version:)

d,e[9];main(){sprintf(e,"date -d@\$((date -d%s +%%s+86400)) +%%m/%%d/%%Y",gets(&d))&system(e);}

• I think this solution will not meet the spec if the given date is 28/02/1900. The correct (real world) answer would be 01/03/1900 but the spec calls for the answer to be 29/02/1900. (And I don't see why you should lose any rep for this answer) Mar 4 '12 at 12:54

C - 293

#define w(x) while(*(i++)!='/');x=atoi(i);
main(){char x[99];scanf("%s",x);f(x);}
f(char* i){
int a=atoi(i),b,c,m[]={0,1,0,1,0,1,0,1,1,0,1,0,1};
w(b);w(c);
if(b==2)if((a==28&&c%4)||a==29){a=1;b=3;}else a++;else if(a-m[b]-30==0)if(b==12){a=b=1;c++;}else{a=1;b++;}else a++;
printf("%d/%d/%d",a,b,c);}

I've never really tried to golf C (and I am by no means an expert in C), but I feel this is pretty good. Basically it goes like this: get input from scanf, convert days, shift pointer, convert months, shift pointer, convert years (latter two have a #define to help), do logic with calendar logic. year%4 was a cool trick, and I have a month hash table indicating if the month is 30 or 31 days (kinda big to declare, but I think it was worth it). Finally, print. I'm sure there is a neat way to refactor using ternary (?:), but again, I'm no expert.

EDIT: fixed some typos.

• Brilliant, someone is having a go. Good start but your program does not work correctly. If you input any date with month != 1, your code outputs day+1/1/year e.g. input: 1/12/1999 -> output: 2/1/1999, input: 24/2/1999 -> output: 25/1/1999. I suspect you maybe have a couple of typos - also remove the #include<stdio.h> you can printf and scanf without it, you'll just get compiler warnings :) Aug 11 '11 at 18:13
• Oh whoops, the error in my program is because I had the mindset DD/MM/YYYY and then switched to MM/DD/YYYY halfway through and mixed it all up. I'm interested in seeing your solution.
– matt
Aug 11 '11 at 19:52
• Hmmm, still not working: 23/06/20101 -> 1/7/20101 Aug 11 '11 at 20:12
• Ok try some test cases now.
– matt
Aug 11 '11 at 20:19
• Looks good to me :) try and chop some characters off now. Try and get a few of those ternary operators in, also consider if taking input via scanf using the same format you printf in is better or worse than parsing the input with a macro. Aug 11 '11 at 20:46

106 100 characters

Another entry that breaks the year rule by supporting only the years 1 to 9999, and also implements correct leap year handling instead of following requirements. The code simply uses POSIX libraries while abusing the type system:

t[9],b[9],*f="%d/%m/%Y";main(){gets(b);strptime(b,f,t);t[3]++;mktime(t);strftime(b,99,f,t);puts(b);}

• You could save 7 characters by using gets instead of read and moving the gets call into strptime. Mar 4 '12 at 13:51
• @marinus: Thanks, I had completely forgotten gets. I didn't move the call inside strptime, since treating the implicit int return value as a pointer is likely to crash on 64-bit systems.
– han
Mar 4 '12 at 17:00


text:
# Dumping SQL Server Tables to CSV Files (Part 2)

There's more than one way to do it isn't just a Perl thing; just about every automation task you can imagine can be done in more ways than you can imagine. I just posted a script the other day to dump tables from a SQL Server database into CSV files using PowerShell and the venerable sqlcmd Utility. One of the challenges is getting the various parameters for sqlcmd passed in properly from PowerShell, and I did it using an array of arguments and some awkward string escaping.

Today I learned that PowerShell already has the Invoke-Sqlcmd cmdlet, which is designed to (mostly) replace sqlcmd. By using Invoke-Sqlcmd, we can bypass all the argument array ugliness and write a simpler script:

$tableQuery = @" SET NOCOUNT ON SELECT sobjects.name FROM sysobjects sobjects WHERE sobjects.xtype = 'U' "@$loc = Get-Location

$server = ".\SQLEXPRESS"$db = "[dbname]"

$tables = Invoke-Sqlcmd -ServerInstance$server -Database $db -Query$tableQuery

$tables | select -ExpandProperty name | select @{Name="filename";Expression={Join-Path -Path$loc -ChildPath "$_.csv"}}, @{Name="query";Expression={"SET NOCOUNT ONnSelect * From$_"}} | % {
Invoke-Sqlcmd -ServerInstance $server -Database$db -Query $_.query | Export-Csv$_.filename -NoTypeInformation
}

Set-Location $loc  This is much more readable. The only part that might not be immediately obvious is the use of the $loc variable for storing the current location when we start the script.

The reason for this is that Invoke-Sqlcmd takes advantage of PowerShell's ability to treat everything kind of like a file system. PowerShell can change context to work within things like the registry as easily as it can change to different drive volumes (e.g., open PowerShell and try cd HCKU:, then try dir, then be very, very careful). In the same way, it can also work within SQL Server. Using Invoke-Sqlcmd will change the context to be the SQL Server instance, which is super convenient if you're doing a lot of SQL Server stuff.

But here we want to dump all the tables to files in the folder where we ran the script. So we need to keep track of that location (using Get-Location) and make sure that we have an absolute path for the output location of Export-Csv (using Join-Path). And, at the end, we want to make sure to return to our original location instead of hanging around in SQL Server space.

Even with that little bit of overhead, Invoke-Sqlcmd is a much cleaner and easier way of performing this kind of task.

Comment

# Dumping SQL Server Tables to CSV Files

A while back I had a client who requested a data dump of a SQL Server database to a set of CSV files (one for each table). I whipped up a PowerShell script to do it using sqlcmd.exe, and I thought I'd post it here in case someone else found it useful (or I wanted to remember how to do it someday).

(I later found out that they wanted the CSV files for manual one-at-a-time import into MySQL; the whole process could have been accomplished with about ten minutes of work in MySQL Workbench. If you've already got a programmer available, always explain what your end goal is (even if you, yourself, are a programmer); they might know of a better way.)

Here's the script:

$tableQuery = @" SET NOCOUNT ON SELECT sobjects.name FROM sysobjects sobjects WHERE sobjects.xtype = 'U' "@$sqlcmd = "C:\Program Files\Microsoft SQL Server\110\Tools\Binn\sqlcmd.exe"
$server = ".\SQLEXPRESS"$db = "[dbname]"

$arguments = @("-S",$server, "-d", $db, "-E", "-h", "-1", "-W", "-Q", ""${tableQuery}"")

$tables = &$sqlcmd $arguments$tables | select @{Name="filename";Expression={"$_.csv"}}, @{Name="query";Expression={"SET NOCOUNT ONnSelect * From$_"}} | % {

$arguments = @("-S",$server, "-d", $db, "-E", "-s", "","", "-W", "-Q", ""$($_.query)"") (&$sqlcmd $arguments) >$_.filename
}

First we set up the query to list all the tables in the database. Filtering by xtype of 'U' gives us the just the user tables in the database. If we wanted, we could also do further filtering on; for example, if we didn't want to include the ASP.NET Identity tables, we could add something like And sobjects.name not like '%asp%'.

The next few lines are just the location of sqlcmd.exe, and the database server and name to pass to all the commands. I'm running all this stuff as a trusted user (the -E in the sqlcmd options), so I don't have to worry about setting up the username and password.

Now comes the the hard part; passing arguments from PowerShell to older DOS command-line utilities can be... challenging to get right. Here, I'm building an array of all the arguments; when I pass it as an argument to & \$sglcmd, PowerShell automatically expands it and passes the arguments correctly. It's possible there's a simpler way to do it, but this works well enough. The arguments of interest:

• -h -1 tells sqlcmd not to print the headers at all. I just need the list of table names; I don't need headers.
• -W removes trailing whitespace
• -Q will run the query and then exit sqlcmd. As opposed to -q, which runs the query and keeps sqlcmd open.

We retrieve the list of tables and pipe it into a Select-Object command which uses the table name to generate a .csv file name and a Select * From query. Those properties are piped into a For-Each which executes each SELECT statement and dumps the results into the CSV file. This time around, we change a couple of the sqlcmd options:

• -s "," tells sqlcmd to use a comma as the column separator
• We drop the -h -1 because we want headers on the tables; the sqlcmd default is to print them once for each query, which is what we want in this case

Happy data wrangling!

Comment


text:
# Countable compact spaces as ordinals

I heard at some point (without seeing a proof) that every countable, compact space $X$ is homeomorphic to a countable successor ordinal with the usual order topology. Is this true? Perhaps someone can offer a sketch of the proof or suggest a topology/ordinal text which treats countable spaces in depth. I also wonder if these spaces are metrizable or if they can be embedded into $\mathbb{R}$.

By the way, I'm assuming $X$ is Tychonoff but perhaps this can be reduced to a weaker separation axiom.

Edit: Just to clarify and avoid erroneous future editing,"countable compact space" means "compact space, whose underlying set is countable." This is different from "countably compact space."

-
I'm not 100% sure that this fits [descriptive-set-theory], it does seems to be somewhere on the border though. – Asaf Karagila May 11 '11 at 6:05
Hausdorff will do (with compact it implies even normality); and T_1 will not (cofinite spaces, e.g.). – Henno Brandsma May 11 '11 at 21:10
@Paul You have changed the question to be something that I wasn't asking. I don't believe countably compact is equivalent to compact and countable. – J.K.T. May 19 '13 at 14:12
@J.K.T.: Sorry. It does. – Paul May 20 '13 at 1:39

I believe that you are looking for ideas from the Cantor Bendixson theorem.

The main idea of the proof is the Cantor-Bendixson derivative. Given a closed set $X$, the derived set $X'$ consists of all limit points of $X$. That is, one simply throws out the isolated points. Continuing in a transfinite sequence, one constructs $X_\alpha$ as follows:

• $X_0=X$, the original set.
• $X_{\alpha+1}=(X_\alpha)'$, the set of limit points of $X_\alpha$.
• $X_\lambda=\bigcap_{\alpha\lt\lambda}X_\alpha$, for limit ordinals $\lambda$.

Thus, $X_1$ consists of the limit points of $X$, and $X_2$ consists of the limits-of-limits, and so on. The set $X_\omega$ consists of points that are $n$-fold limits for any particular finite $n$, and $X_{\omega+1}$ consists of limits of those kind of points, and so on. The process continues transfinitely until a set is reached which has no isolated points; that is, until a perfect set is reached. The Cantor Bendixon rank of a set is the smallest ordinal $\alpha$ such that $X_\alpha$ is perfect.

The concept is quite interesting historically, since Cantor had undertaken this derivative before he developed his set theory and the ordinal concept. Arguably, it is this derivative concept that led Cantor to his transfinite ordinal concept.

It is easy to see that the ordinal $\omega^\alpha+1$ under the order topology has rank $\alpha+1$, and one can use this to prove a version of your desired theorem.

The crucial ingredients you need are the Cantor Bendixson rank of your space and the number of elements in the last nonempty derived set. From this, you can constuct the ordinal $(\omega^\alpha+1)\cdot n$ to which your space is homeomorphic. Meanwhile, every countable ordinal is homeomorphic to a subspace of $\mathbb{Q}$, and is metrizable. The compact ordinals are precisely the successor ordinals (plus 0).

Update 5/11/2011. This brief article by Cedric Milliet contains a proof of the Mazurkiewicz-Sierpiński theorem (see Stefan Mazurkiewicz and Wacław Sierpiński, Contribution à la topologie des ensembles dénombrables, Fundamenta Mathematicae 1, 17–27, 1920), as follows:

Theorem 4. Every countable compact Hausdorff space is homeomorphic to some well-ordered set with the order topology.

The article proves more generally that any two countable locally compact Hausdorff spaces $X$ and $Y$ of same Cantor-Bendixson rank and degree are homeomorphic. This is proved by transfinite induction on the rank, and the proof is given on page 4 of the linked article.

-
I believe the name is BendixSon. – Raeder May 10 '11 at 15:46
Thanks, I have corrected and added a reference article. – JDH May 11 '11 at 20:18
The list of things that someone should have told me about in nine years of studies of higher mathematics continues to lengthen: this is a really pretty result! – Pete L. Clark May 11 '11 at 20:36
The book by Semadeni, "Banach spaces of continuous functions" treats the countable compact Hausdorff spaces (the characterisation is needed for the treatment of the Banach space on it, as per the title), with complete proofs. This is where I first saw it. It's, fittingly, a book by a Pole. – Henno Brandsma May 11 '11 at 21:09
Thanks very much, this is an excellent answer. – J.K.T. May 12 '11 at 3:23

Call a topological space good if it's homeomorphic to a compact ordinal.

Lemma 1. Every countable compact Hausdorff space is first countable, zero-dimensional, and scattered.

Proof. These are well known facts.

Lemma 2. A closed subspace of a good space is good.

Proof. This follows from the fact that a closed subspace of an ordinal is homeomorphic to an ordinal.

Lemma 3. Let $S$ be a countable compact Hausdorff space. If each point of $S$ has a good clopen neighborhood, then $S$ is good.

Proof. By compactness, $S$ is covered by finitely many good clopen sets, which (by Lemma 2) can be made disjoint. Thus $S$ is the union of finitely many disjoint clopen sets $X_1,\dots,X_n$, where each $X_i$ is homeomorphic to a compact ordinal $\alpha_i$. It follows that $S$ is homeomorphic to the compact ordinal $\alpha=\alpha_1+\dots+\alpha_n$. (This is because $S$ is the topological sum of the $X_i$'s, and $\alpha$ is the topological sum of disjoint clopen subsets $A_i$, where $A_i$ is homeomorphic to the ordinal $\alpha_i$ and thus to $X_i$.)

Theorem. Every countable compact Hausdorff space is homeomorphic to an ordinal.

Proof. Let $S$ be a countable compact Hausdorff space. Assume for a contradiction that $S$ is not good. Let $X$ be the set of all points of $S$ which have no good clopen neighborhood. By Lemma 3, $X$ is nonempty. Since $S$ is scattered, $X$ has an isolated point $x$. (Of course $x$ is not isolated in $S$, since $\{x\}$ would then be a good clopen neighborhood of $x$.)

Let $U_1$ be a clopen neighborhood of $x$ such that $U_1\cap X=\{x\}$. Note that, by Lemmas 2 and 3, every clopen subset of $U_1$ which does not contain $x$ is good.

Let $U_1,U_2,\dots,U_n,\dots$ be a neighborhood base for $x$ such that each $U_n$ is clopen and properly contains $U_{n+1}$. Then the (nonempty) set $V_n=U_n\setminus U_{n+1}$ is a good clopen set, whence it is homeomorphic to a compact ordinal $\alpha_n$. It follows that the set $U_1\setminus X=V_1\cup V_2\cup\dots\cup V_n\cup\dots$, which is the topological sum of the $V_n$'s, is homeomorphic to the limit ordinal $\alpha=\alpha_1+\alpha_2+\dots+\alpha_n+\dots$. Hence $U_1$, the one-point compactification of $U_1\setminus\{x\}$, is homeomorphic to the ordinal $\alpha+1$, the one-point compactification of $\alpha$. Thus $U_1$ is a good clopen neighborhood of $x$, which was assumed to have no good clopen neighborhood. This contradiction proves the theorem.

-

In fact, you can prove directly that any countable compact space $X$ is metrizable:

Let $A$ be a family of continuous functions from $X$ to $\mathbb{R}$ and let $e : \left\{ \begin{array}{ccc} X & \to & \mathbb{R}^A \\ x & \mapsto & (f(x)) \end{array} \right.$. If the family $A$ distinguishes points and closed sets in $X$, then $e$ embedds $X$ into $\mathbb{R}^A$; since $X$ is completely regular, such a family $A$ exists. Taking the linear subspace spanned by $e(X)$, you can suppose $A$ countable.

Therefore, $X$ is a subspace of $\mathbb{R}^{\omega}$; by compactness, $X$ is in fact a subspace of a product of intervals $\prod\limits_{\omega} I_k$. Since each $I_k$ is homeomorphic to $[0,1]$, $X$ is a subspace of $[0,1]^{\omega}$.

But $[0,1]^{\omega}$ is metrizable, $d : (x,y) \mapsto \sum\limits_{n \in \omega} \frac{1}{2^n}|x_n-y_n|$ defines a distance over it.

Moreover, since any metrizable space can be embedded into a normed space, you can use the proof given in [Stefan Mazurkiewicz and Wacław Sierpiński, Contribution à la topologie des ensembles dénombrables, Fundamenta Mathematicae 1, 17–27, 1920] to prove the classification you mention:

First notice that the Cantor-Bendixson rank of a countable compact space is a successor countable ordinal $\alpha+1$ and that $X_{\alpha}$ is finite. Then for any countable ordinal $\alpha$ and positive integer $n \geq 1$, let $P(\alpha,n)$ be the assertion: "Any countable compact space of Cantor-Bendixson rank $\alpha+1$ such that $\text{card}(X_{\alpha})=n$ is homeomorphic to $\omega^{\alpha} \cdot n+1$."

Clearly, $P(1,1)$ is true (here $X$ is just a converging sequence).

Step 1: If $P(\alpha,1)$ is true then $P(\alpha,n)$ is true.

Let $X_{\alpha}=\{p_1, \dots,p_n\}$. Then, viewing $X$ as a subspace of a normed space $Y$, there exist $n-1$ parallel hyperplanes $P_1$, ..., $P_{n-1}$ such that $Y \backslash \bigcup\limits_{i=1}^{n-1} P_i$ has $n$ connected components $D_1$, ..., $D_n$ with $p_k \in D_k$.

Because $P(\alpha,1)$ is true, each $X_k:= X \cap D_k$ is homeomorphic to $\omega^{\alpha}+1$. Therefore, $X$ is homeomorphic to $(\omega^{\alpha}+1) \cdot n= \omega^{\alpha} \cdot n+1$.

Step 2: If $P(\alpha,n)$ is true for any $\alpha<\alpha_0$ and $n \geq 1$, then $P(\alpha_0,1)$ is true.

Let $X_{\alpha_0}=\{p\}$ and let $(p_k)$ be a sequence in $X'$ converging to $p$ (without loss of generality, we suppose $\alpha_0 \geq 2$ so that $p \in X''$). Then, viewing $X$ as a subspace of a normed space $Y$, there exist a sequence of postive real numbers $(r_k)$ converging to zero such that the family of spheres $S(p,r_k)$ does not meet $X$ and $Y \backslash \bigcup\limits_{k \geq 1} S(p,r_k)$ has infinitely many connected components $D_1$, $D_2$, ... with $p_k \in D_k$.

By assumption, each $X_k:= X \cap D_k$ is homeomorphic to some $\omega^{\alpha_k} \cdot n_k+1$ with $\alpha_k <\alpha_0$ and $n_k \geq 1$. Therefore, $X$ is homeomorphic to $$\tau=[(\omega^{\alpha_1} \cdot n_1+1)+(\omega^{\alpha_2} \cdot n_2+1)+ \dots ]+1$$

But $\tau \leq \omega^{\alpha_0} +1$. If $\tau < \omega^{\alpha_0}+1$ then $\tau< \omega^{\alpha_0}$ because $\tau$ is compact, hence $X_{\alpha_0}= \emptyset$: a contradiction. Therefore, $\tau = \omega^{\alpha_0}+1$ and $P(\alpha_0,1)$ is true.

Step 3: We conclude by transfinite induction.

-