text:
# How secure is ChaCha20? [closed]

I want to implement a stream cipher to encrypt very sensitive data in my Python code. I heard about the ChaCha20 algorithm and the PyCryptodome library , but how secure is it ?

• Possible duplicate of How secure is Salsa20? – Ella Rose Sep 30 '18 at 15:35
• @EllaRose Although I can see where you're coming from when comparing ChaCha20 with Salsa20, I can imagine that users of this site may not. A bit more info about Salsa20 would be welcome. Besides that, it does use a new round function; it may not be directly obvious how much this would influence security. – Maarten Bodewes Oct 1 '18 at 14:39
• @MaartenBodewes It does say possible duplicate ;) – Ella Rose Oct 1 '18 at 15:30
• We cannot and should not comment here on the security of a library. You'd need to perform comprehensive research for that, possibly including a review of the given implementation (if those haven't been performed and well documented before). Answers here should focus on the algorithm alone and if the algorithm can be implemented securely. – Maarten Bodewes Oct 1 '18 at 16:48

• Aumasson et al. Showed that ChaCha6 can be attacked with time complexity $$2^{139}$$ and ChaCha7 with $$2^{248}$$.
• Shi et al. gave an attack based on second-order differential with $$2^{136}$$ for ChaCha6 and $$2^{246.5}$$ for ChaCha7.
• Maitra, chosen IV cryptoanalysis and the time complexity of the attack showed that it can be reduced to $$2^{239}$$ for ChaCha7.
• Choudhuri and Maitra concluded ChaCha12 are sufficient for 256-bit keys against differential cryptanalysis using a hybrid model of non-linear round functions and linear approximation...

$$\begin{array} {|l|l|} \hline Attack & Evaluation \\ \hline \text{Differential Analysis } & \text{No attack found}\\ \text{Rotational Cryptanalysis} & \text{No attack found}\\ \text{Boomerang Attack} & \text{No attack found} \\ \text{Linear Cryptanalysis} & \text{No attack found}\\ \text{Distinguishing Attack} & \text{No attack found}\\ \text{Guess and Determine Analysis} & \text{No attack found}\\ \text{Time-Memory-Data Tradeoff Attack } & \text{Protected}\\ \text{Practically ChaCha Algebraic Attack} & \text{No attack found} \\ \text{Attacks on Initialization Process} & \text{No attack found}\\ \text{Single Power Analysis } & \text{Protected}\\ \text{Practically Difference Power Analysis } & \text{Protected Practically}\\ \text{Cache Timing Attack} & \text{No attack found}\\ \text{Fault Injection Analysis } & \text{Protected Practically}\\ \hline \end{array}$$

The above table and results come from KDDI Research, Inc

• simple power attack; though the rotation is vulnerable to power attack, they propose masking as a countermeasure.
• differential power analysis; they demonstrated that adversary can get all keys except $$k_1$$ which can be found in $$2^{32}$$, proposed masking as a countermeasure.
• Fault Injection Attack; they claim that the initial matrix $$X$$ or matrix $$X^{(20)}$$ will be output if injection is performed on the addition.

A countermeasure against this sort of attacks is to separate variables; that is, distinct variables store the inputs and output of the addition. Consider an addition $$z \leftarrow x+y$$. The addition returns the initial value of variable z even if the addition is skipped. Thus, the adversary can get neither the value of variables $$x$$ and $$y$$. Algorithm 9 shows the implementation using countermeasure based on variable separation.

We should note that variable separation in source-code level does not work

They include all attacks upto 2017 in their document. I couldn't find one in 2018.

• How is the conclusion that ChaCha is practically resistant to fault injection reached? That one seems highly dependent on hypothesis made. At least in a setup where the same Chacha calculation is performed multiple times, it seems fault injection could work. – fgrieu Oct 1 '18 at 11:42
• If you want, Ill we go deeper. – kelalaka Oct 1 '18 at 15:38

ChaCha20 is a "primitive", in other words it's just one component of a secure cryptographic system (and PyCryptodome is a collection of primitives). So in a way, and from the perspective of a programmer, it's not secure at all. It's dangerous to use something so low-level.

In order to implement a secure crypto system, you need more than just encryption. Go with something like Cryptography or PyNaCl - they have already done all the work for you.

• I've voted this down. On StackOverflow this could possibly count as an answer, as the question could suffer from the X-Y problem. But on crypto, when asked about the security of an algorithm, we want to focus on just that - not the protocol or system that the algorithm is used in. – Maarten Bodewes Oct 1 '18 at 16:45
• Sure, I definitely answered the "real" question here. Maybe flag so that it can be converted into a comment. Or we change the question. – Stefano Palazzo Oct 1 '18 at 18:59


text:
Research Article| Volume 57, ISSUE 10, P380-385, October 2022

Ok

# Impact of the COVID-19 pandemic on management and outcomes of children with appendicitis: The Children with AppendicitiS during the CoronAvirus panDEmic (CASCADE) study

• Author Footnotes
# Members of the CASCADE Study collaborators and RIFT Study Collaborators groups are listed in the Acknowledgement section.
Open AccessPublished:April 02, 2022

## Abstract

### Aim

To report the impact of the SARS-CoV-2 pandemic on management and outcomes of paediatric appendicitis in the UK and Ireland.

### Methods

Prospective, multicentre observational cohort study at general surgical and specialist paediatric surgical centres in the United Kingdom and Ireland from 1st April to 31st July 2020. Primary outcome was treatment strategy used for acute appendicitis.

### Results

This study includes 2002 children treated for acute appendicitis of a median age of 10 (range 1–15) years and 605 children from a similar data set pre pandemic from 2017. In the pandemic cohort 560/2002(28%) were initially treated non operatively of whom 125/560(22%) proceeded to appendicectomy within initial hospital admission. Non operative treatment wasn't used in the pre pandemic cohort. Diagnostic imaging use was greater during the pandemic compared to pre pandemic (54vs31%; p < 0.00001) but overall use of laparoscopy was similar during both time periods (62.4vs66.6%). Hospital readmission rate was lower (8.7vs13.9%; p = 0.0002) during the pandemic than pre pandemic and Re-intervention rate was similar (2.9vs2.6%;p = 0.42). In cases treated operatively negative appendicectomy rate was lower during the pandemic than pre pandemic (4.4vs15.4%; p =0.0001), and during the pandemic was amongst the lowest ever reported in the UK.

### Conclusion

COVID-19 has had a significant impact on the management of children with appendicitis in the UK and Ireland. The rate of imaging and the use of non operative management increased, whilst the negative appendicectomy rate reduced. Overall, patient outcomes have not been adversely impacted by change in management during the pandemic.

Level I.

### Type of study

Prognosis study.

## Keywords

• The SARS-CoV-2 pandemic brought about changes in management of appendicitis including increasing use of non operative treatment.
• The impact of these changes are uncertain.
• Until this time non operative treatment for paediatric appendicitis in the UK has been limited to trials.
• Patient outcomes have not been adversely impacted by change in management during the pandemic, rather some important outcomes have improved.
• The negative appendicectomy rate at 4.4% is one of the lowest ever reported in the UK.
• The widespread, real world use of non operative treatment in general and specialist settings resulted in acceptable patient outcomes.

## 1. Introduction

Acute appendicitis is the most common surgical condition in children and in the United Kingdom (UK) treatment of children with appendicitis is shared between general surgeons (GS) in district general hospitals and specialist paediatric surgeons (SPS) at specialist paediatric centres [
• Giuliani S.
• Cecil E.V.
• Apelt N.
• et al.
Pediatric emergency appendectomy and 30-day postoperative outcomes in district general hospitals and specialist pediatric surgical centers in england, april 2001 to march 2012: retrospective cohort study.
]. Typically treatment is surgical with the majority of cases undergoing urgent appendicectomy; non operative treatment of acute appendicitis in children is not widespread in the UK.
The SARS-CoV-2 (COVID-19) pandemic caused widespread disruption to the provision of all healthcare but to surgical care in particular, for a wide variety of reasons including staff redeployment, operating theatre availability and concerns about transmission of SARS-CoV-2 from patients to healthcare staff [
• De Simone B.
• Chouillard E.
• Di Saverio S.
• et al.
Emergency surgery during the COVID-19 pandemic: what you need to know for practice.
]. Guidance during the first few weeks of the pandemic from the Royal College of Surgeons of England suggested that laparoscopy should only be used in procedures where the risk of an open procedure to the patient outweighed the potential risk to staff in theatre, as laparoscopy was believed to be an aerosol generating procedure (AGP) [
• De Simone B.
• Chouillard E.
• Di Saverio S.
• et al.
Emergency surgery during the COVID-19 pandemic: what you need to know for practice.
]. It was also recommended that non operative treatment should be used to avoid surgery for all conditions, including appendicitis, if it was considered an acceptable alternative treatment option [

Joint guidance for surgeons: guidance for surgeons working during the COVID-19 pandemic from the Surgical Royal Colleges of the United Kingdom and Ireland. Royal College of Surgeons of England. https://www.rcseng.ac.uk/coronavirus/joint-guidance-for-surgeons-v1/, 2020.

]. As the pandemic progressed, emerging data revealed that surgery in adults infected with Covid-19 was associated with adverse outcomes, including increased mortality [
• Collaborative C.
Mortality and pulmonary complications in patients undergoing surgery with perioperative SARS-CoV-2 infection: an international cohort study.
]. All of these factors had significant impact on the management of children with appendicitis and early reports from the pandemic observed a shift from operative to non operative treatment, and from laparoscopic to open appendicectomy [
• Bethell G.S.
• Rees C.M.
• Sutcliffe J.R.
• et al.
Management and early outcomes of children with appendicitis in the UK and Ireland during the COVID-19 pandemic: a survey of surgeons and observational study.
].
The potential impact of these widespread changes in healthcare delivery for children with appendicitis were unknown. Amidst this uncertainty and concern that patient outcomes may be negatively affected, the CASCADE study (Children with AppendicitiS during the CoronAvirus panDEmic) was initiated in late March 2020 to capture data relating to the impact of the pandemic on the management and outcomes of children with appendicitis. Initially, paediatric and adult surgeons in the UK who treat children with appendicitis were surveyed to understand the anticipated impact of the pandemic on management of children with appendicitis [
• Bethell G.S.
• Rees C.M.
• Sutcliffe J.R.
• et al.
Management and early outcomes of children with appendicitis in the UK and Ireland during the COVID-19 pandemic: a survey of surgeons and observational study.
]. This was followed by an observational cohort study during the first wave of the pandemic in the UK and Ireland. Initial data from the first 2 months of this study have previously been published [
• Bethell G.S.
• Rees C.M.
• Sutcliffe J.R.
• et al.
Management and early outcomes of children with appendicitis in the UK and Ireland during the COVID-19 pandemic: a survey of surgeons and observational study.
]. This report details the findings of the full 4 months of study and by comparing data to a pre-pandemic cohort aims to investigate the impact of the pandemic on patient management and important outcomes.

## 2. Methods

### 2.1 Cohort study design

A prospective multicentre observational cohort study of children aged less than 16 years at time of hospital admission who were diagnosed with and treated for acute appendicitis in the UK and Ireland was performed. Participating hospitals, including district general hospitals and specialist paediatric surgery centres, were not required to alter diagnostic or treatment pathways and no changes were made to patient care as part of this study.

### 2.2 Centre recruitment and patient identification

Hospitals providing acute surgical care to children were invited to participate in this study via a number of channels including targeted emails, newsletters, social media and websites of surgical and paediatric national organisations including the British Association of Paediatric Surgeons, the Royal College of Surgeons of England, and the Royal College of Paediatrics and Child Health. Children were included in the study if they were diagnosed with and treated for acute appendicitis in hospital. Diagnosis was based on clinical and/or radiological criteria. Children who presented with abdominal pain but not felt to have appendicitis were excluded, however those treated for appendicitis initially but then given an alternative diagnosis were included. This study includes all children with an initial admission date between April 1st 2020 and July 31st 2020. Follow-up was censored at 30 days post hospital discharge from initial admission. Data were collected at 72 hospitals in the UK and 2 in Ireland of which 29 were specialist paediatric surgery centres and the remainder were district general hospitals where children were treated by general surgeons.

### 2.3 Ethical considerations

This study was registered at each site as a service evaluation, as defined by the health research authority guidance, as this was an observational study only collecting routine anonymised data with no change to clinical care pathways.

### 2.4 Outcomes

The primary outcome was the initial treatment strategy for acute appendicitis, defined as surgical or non operative. Secondary outcomes related to patient management included number and proportion of operative cases performed open and laparoscopically, use of diagnostic imaging and variation in patient management over time, as the pandemic progressed. Clinical outcomes were success rate of non operative treatment (defined as no appendicectomy within initial hospital inpatient episode in a case in whom the initial treatment strategy was non operative), need for hospital readmission, wound infection, bowel obstruction, intra-abdominal collection, further intervention, length of hospital stay, negative appendicectomy and mortality. Re-intervention was defined as an invasive procedure, either surgical or radiological intervention such as drainage of collection. Negative appendicectomy was defined as absence of pathology on, histological assessment of the appendix. These outcomes were all reported to 30 days following initial hospital admission and were selected as important outcomes from a core outcome set for paediatric appendicitis [
• Sherratt F.C.
• Allin B.S.R.
• Kirkham J.J.
• et al.
Core outcome set for uncomplicated acute appendicitis in children and young people.
].

### 2.5 Pre COVID-19 pandemic cohort

In order to compare outcome and management to a pre-COVID-19 cohort the complete dataset from the Right Iliac Fossa Treatment (RIFT) study was obtained with permission [
Collaborative RSGobotWMR
Appendicitis risk prediction models in children presenting with right iliac fossa pain (RIFT study): a prospective, multicentre validation study.
]. This study included patients of all ages who were admitted to hospital during a pre-specified four-week period between 13th March and 18th June 2017 with right iliac fossa pain. Data were collected at 130 hospitals in the UK and 9 in Ireland of which 17 were specialist paediatric surgery centres and the remainder were district general hospitals where children were treated by general surgeons. Patients were only included in a comparison cohort if they were <16 years old and were treated for suspected appendicitis in the UK and Ireland. Those treated for other diagnoses were excluded.
Comparisons were made, where possible, between the primary and secondary outcomes of the pre-pandemic and pandemic cohorts.

### 2.6 Data collection and analysis

Anonymous data were collected by local study teams within each hospital and submitted to the study team monthly. Data were checked for duplication since we were aware that some cases were transferred from one hospital to another during the study period (typically from a district general hospital to a local specialist paediatric surgery centre) and we wished to avoid duplication. Duplicated data records were identified and excluded if all of age, sex, CRP and WCC at admission were identical or if flagged as a child that was transferred between centres and therefore appeared in the dataset more than once.
Statistical analysis was performed using StataSE v15 (StataCorp LLC, Texas, USA) and the figures were produced using GraphPad Prism v8 (GraphPad Software, La Jolla California USA). Data are presented as median (IQR or range) and/or number/total (%) as appropriate. Fisher's exact test or chi-squared test, as appropriate, were used for comparison of categorical data and the Mann Whitney-U test was used for non parametric continuous data. A p value of less than 0.05 was considered as statistically significant. The study was conducted according to Strengthening the Reporting of Observational studies in Epidemiology (STROBE) guidelines for observational studies [
• von E.E.
• Altman D.G.
• Egger M.
• et al.
The Strengthening the Reporting of Observational Studies in Epidemiology (STROBE) statement: guidelines for reporting observational studies.
].

## 3. Results

### 3.1 Children included and diagnostic investigations

In the pandemic cohort, there were 2002 children treated for appendicitis between April 1st and July 31st 2020 in 74 centres with a median age of 10 (range 1–15) years. Clinical characteristics and diagnostic investigations used are shown in Table 1. At the point of diagnosis 1464 children (73.5%) were suspected by the treating surgeon to have simple acute appendicitis, 458 (23.0%) complicated appendicitis and 71 (3.6%) an appendix mass (data missing in 9 cases). At time of diagnosis of acute appendicitis the COVID-19 status was known positive in 5 (0.3%) children, known negative in 440 (22.0%) children, tested awaiting result in 1117 (55.8%) children and 440 (22.0%) children were untested. Three children (0.1%) were initially treated for appendicitis but subsequently were diagnosed with Paediatric Multisystem Inflammatory Syndrome (PIMS-TS), of these 2 children were treated non operatively whilst one child underwent laparoscopic appendicectomy.
Table 1Clinical characteristics and management of children treated prior to and during the COVID-19 pandemic.
Pre-pandemic (n = 605)Pandemic (n = 2002)
Age (years)11 (9–13)10 (8–13)
Male (n,%)341 (56.4)1210 (60.4)
Speciality (n,%)GS470 (77.7)818 (40.9)
SPS135 (22.3)1184 (59.1)
Admission bloodsWCC – x109/L14.4 (9.8–18)14.9 (11.6–18.1)
CRP - mg/L25 (5–75.5)42 (12–105)
US performed (n,%)182 (30.1)985 (49.2)
CT/MRI performed (n,%)8 (1.3)97 (4.9)
Non operative management (n,%)0 (0)560 (28.0)
Laparoscopic appendicectomy$(n,%)403 (66.6)898 (62.4) GS – general surgeon; SPS – specialist paediatric surgeon; WCC – white cell count; CRP – C-reactive protein; L – litre; mg – milligrams; US – ultrasound; CT – computer tomography; MRI – magnetic resonance imaging.$-initial operative management. Continuous data are median (IQR).
The pre-pandemic cohort (Table 1) comprised 605 children treated for appendicitis at 139 centres between 13th March and 18th June 2017 with a median age of 11 (range 1–15) years. In the pandemic cohort a greater proportion of cases were treated by SPS compared to GS than pre-pandemic and diagnostic imaging was used more frequently than pre-pandemic (54 vs 31%; p < 0.00001). Across both cohorts, diagnostic imaging was used more frequently by SPS than GS (pandemic: 55 vs 46%, p < 0.001; pre-pandemic: 38 vs 29%, p = 0.04).

### 3.2 Management strategy

During the pandemic there was a significant shift towards non operative management such that 28% of cases were initially managed non operatively during the pandemic compared to none in the pre-pandemic cohort. As the pandemic progressed there was a gradual reversal of this shift back toward surgical management (Fig. 1). Where operative management was undertaken, the rate of laparoscopic, versus open appendicectomy, overall was similar in the pandemic and pre-pandemic cohorts. In the pandemic cohort there was evidence of a change in practice over time with an increase in proportion of cases performed laparoscopically over the 4 months period (Fig. 2).

### 3.3 Patient outcomes

Overall outcomes amongst the two cohorts are shown in Table 2. At 30-days there were no reported deaths. Regardless of treatment method, the readmission rate was higher in the pre pandemic cohort compared to the pandemic cohort however the Re-intervention rate was similar. Readmission rate was similar between children treated by GS and SPS (9.4 vs 8.3%, p = 0.38). Findings were similar at only SPS centres compared to the whole cohort of children (supplementary table).
Table 2Outcomes of children treated prior to and during the COVID-19 pandemic.
Pre pandemic (n = 605)Pandemic (n = 2002)p
Length of stay, days (IQR)3 (2–4)3 (2–5)0.03
Re-intervention$(n,%)15 (2.6)41 (2.9)0.42 Histology for cases treated surgically (n,%) Normal93 (15.4)58 (4.4)0.0001 Simple260 (43.1)720 (54.7) Complicated216 (35.8)494 (37.5) Other34 (5.6)44 (3.3) Histology not available in 2 children in pre pandemic cohort and 123 children in pandemic cohort.$-initial operative management. Continuous data are median (IQR).

### 3.4 Outcomes of operative treatment

In cases treated operatively, outcomes were stratified by surgical findings (Table 3) since severity of appendicitis is well recognised to predict post operative management and clinical course (note cases of appendix mass are excluded from this comparison). Macroscopic appearance of the appendix at operation was either normal (n = 63, 4.4%), inflamed (n = 748, 52.8%), gangrenous (n = 143, 10.1%), perforated (n = 421, 29.7%) or appendix mass (n = 43, 3.0%). For further analysis in this section and Table 3, simple and no appendicitis have been grouped together and, gangrenous and perforated appendicitis has been grouped (complicated appendicitis) together since the post operative management is typically stratified by operative findings in this way.
Table 3Comparative operative outcomes between pandemic and pre pandemic cohorts stratified by operative findings.
Simple or No appendicitisComplicated appendicitis
Pandemic (n = 811$)Pre pandemic (n = 390&)pPandemic (n = 564$)Pre pandemic (n = 214&)p
Re admission (n,%)30 (3.7)40 (10.3)<0.000180 (14.2)43 (20.1)0.04
Re-intervention (n,%)4 (0.5)5 (1.4)0.1333 (5.9)10 (5.0)0.52
Length of stay (days, median and IQR)2 (1–3)2 (2–3)<0.00015 (3–7)4 (2–6)<0.0001
\$ Operative findings missing in 25 cases. & Operative findings missing in 1 case.
Appendix histology reports were available for 1316/1439 (91%) children that initially underwent operative management. The findings were simple appendicitis in 720 (55%), gangrenous appendicitis in 205 (16%), perforated appendicitis in 289 (22%) and other pathology in 44 (3.3%) children. Other pathology included 6 (0.45%) neuro endocrine tumours (NET). The negative appendicectomy rate was 4.4% (n = 58) in the pandemic cohort and 15.4% (n = 93) in the pre pandemic cohort.
As in previous reports [
• Tiboni S.
• Bhangu A.
• Hall N.J.
Outcome of appendicectomy in children performed in paediatric surgery units compared with general surgery units.
], the negative appendicectomy rate was lower in children treated by SPS compared to GS (3.4 vs 5.9%, p = 0.03). The negative appendicectomy rate was similar in both sexes (52% [male] vs 48% [female], p = 0.15).

### 3.5 Non operative management

No children in the pre pandemic cohort underwent non operative management. In the pandemic cohort clinical, laboratory and radiological characteristics for cases treated surgically and non operatively are shown in Table 4. Cases treated non operatively received antibiotic therapy and typically had less advanced appendicitis with lower CRP and white cell count at diagnosis and were more likely to have suspected simple (as opposed to complicated) appendicitis. A higher proportion of cases treated non operatively had an ultrasound scan than of cases treated surgically. The majority of cases selected for non operative treatment were suspected to be simple appendicitis at the time of diagnosis although a small number of suspected complicated cases were also treated non operatively.
Table 4Clinical, laboratory and radiological characteristics of cases treated initially non operatively or operatively (data for pandemic cohort only).
Non operative (n = 560)Operative (n = 1439)p
Age (years)10 (8–13)10 (8–13)0.21
Male (n,%)330 (58.9)879 (61.1)0.39
Duration of symptoms (hours)36 (24–72)48 (24–72)0.42
Speciality (n,%)GS229 (40.9)589 (40.9)1.00
SPS331 (59.1)850 (59.1)
Admission bloodsWCC – x109/L14.2 (10.5–17.5)15.0 (12.0–18.2)0.0003
CRP - mg/L32 (7.7–87)45 (14–114)<0.0001
US performed (n,%)358 (63.9)624 (43.3)<0.0001
CT/MRI performed (n,%)34 (6.0)62 (4.3)0.76
Suspected severity at diagnosis (n,%)Simple437 (78.3)1027 (71.7)<0.0001
Complicated71 (12.7)385 (26.9)
Appendix mass50 (9.0)20 (1.4)
GS – general surgeon; SPS – specialist paediatric surgeon; WCC – white cell count; CRP – C-reactive protein; L – litre; mg – milligrams; US – ultrasound; CT – computer tomography; MRI – magnetic resonance imaging. Continuous data are median (IQR).

### 3.6 Non operative treatment outcomes

Of the 560 cases treated non operatively, 125 (22% [95%CI 19–26%]) children failed non operative treatment during the initial admission and proceeded to appendicectomy. This was approached via an open procedure in 49 (39%) cases and a laparoscopic procedure in 76 (61%) cases. Where available (missing n = 1), intra-operative findings in those who failed initial non operative treatment were normal appendix in 6 (4.8%) children, simple appendicitis in 50 (40%), complicated appendicitis in 61 (49%) children and appendix mass in 7 (5.7%) children.
Overall the 30-day readmission rate was 11% (47/435) for non operative treatment in those that were discharged home without an operation. Reasons for readmission in the group which underwent non operative treatment without appendicectomy prior to discharge were abdominal collection/abscess (n = 1), abdominal pain (n = 37) and fever (n = 5). In some cases there were multiple reasons for readmission or the reason was not specified. Of those readmitted, 15% (7/47) of children had an appendicectomy within 30-days of initial hospital admission.
Appendix histology reports were also available for 110 of the 125 (88%) children that failed non operative management. The findings were simple appendicitis in 51 (46%), gangrenous appendicitis in 19 (17%), perforated appendicitis in 28 (25%), other pathology in 4 (3.6%) and normal appendix in 8 (7.2%) children. There were no neuroendocrine tumours.

## 4. Discussion

This report of the management of children with appendicitis during the first 4 months (first wave) of the SARS-CoV-2 pandemic in the UK and Ireland demonstrates a clear increase in the use of non operative treatment and open appendicectomy for appendicitis in children compared to a pre COVID19 cohort. This sudden change of practice coincided with the guidance published by the Royal College of Surgeons of England advising non operative treatment wherever possible and cautioning against the use of laparoscopy [
• De Simone B.
• Chouillard E.
• Di Saverio S.
• et al.
Emergency surgery during the COVID-19 pandemic: what you need to know for practice.
]. As the pandemic progressed, guidance evolved and towards the end of July clinical practice was reverting back towards that seen in the pre COVID dataset. Interestingly, 12% of children were still being initiated on non operative treatment at the end of July 2020. This may be owing to ongoing concerns of operative treatment, local policy or a permanent shift in practice owing to increased surgeon familiarity with this treatment method. Importantly, despite this sudden and widespread change in practice there does not appear to have been a negative impact on patient outcomes. In fact it appears there is evidence of improved outcomes that are worthy of discussion and consideration of how to realise these benefits on an ongoing basis.
Undoubtedly the most significant shift in practice was the use of non operative treatment which occurred without any pre defined case selection criteria or treatment protocol. Despite this, the success rate of non operative management was as high as 78% even though 13% of children treated non operatively were suspected to have complicated appendicitis. Non operative treatment has been used here outside the criteria used to date in formal research studies in which it has been evaluated and hence with tighter case selection outcomes may be even better [
• Minneci P.C.
• Mahida J.B.
• Lodwick D.L.
• et al.
Effectiveness of Patient Choice in Nonoperative vs Surgical Management of Pediatric Uncomplicated Acute Appendicitis.
,
• Armstrong J.
• Merritt N.
• Jones S.
• et al.
Non-operative management of early, acute appendicitis in children: is it safe and effective?.
,
• Gorter R.R.
• van der Lee J.H.
• Cense H.A.
• et al.
Initial antibiotic treatment for acute simple appendicitis in children is safe: short-term results from a multicenter, prospective cohort study.
]. These data demonstrate that surgeons are willing to consider non operative treatment (although we note that practice reverted towards operative management over time) and also suggest that non operative treatment may be considered as an effective treatment modality and an alternative to appendicectomy. Whilst we believe that further evaluation of the comparative outcomes of non operative treatment and appendicectomy should be undertaken, non operative treatment of appendicitis in children in the UK outside of a clinical trial is no longer without precedent.
The negative appendicectomy rate seen in this dataset, based on histological findings, is extremely low, and is one of the lowest rates reported in the UK [
• Giuliani S.
• Cecil E.V.
• Apelt N.
• et al.
Pediatric emergency appendectomy and 30-day postoperative outcomes in district general hospitals and specialist pediatric surgical centers in england, april 2001 to march 2012: retrospective cohort study.
,
Collaborative RSGobotWMR
Appendicitis risk prediction models in children presenting with right iliac fossa pain (RIFT study): a prospective, multicentre validation study.
,
• Tiboni S.
• Bhangu A.
• Hall N.J.
Outcome of appendicectomy in children performed in paediatric surgery units compared with general surgery units.
. Alongside this, radiological imaging has been seen more frequently during the COVID-19 dataset compared to the pre pandemic data from 2017. These findings may be directly associated but regardless, this has reduced the burden on stretched healthcare resources whilst protecting children from the risks of surgery when they have not got appendicitis. The high negative appendicectomy rate observed in the UK has been highlighted recently to be of significant public interest [
Collaborative RSGobotWMR
Appendicitis risk prediction models in children presenting with right iliac fossa pain (RIFT study): a prospective, multicentre validation study.
,

Donnelly L. Women needlessly having their appendix out in almost one in three cases. The Daily Telegraph.

. The results of this study are therefore encouraging but ongoing work is required to maintain this unanticipated benefit of management during the pandemic. The low negative appendicectomy rate may be explained in this non randomised study by surgeons opting to treat children for appendicitis where there is still some diagnostic uncertainty. Hence, children who didn't have appendicitis may have been treated non operatively. It is also possible that there was overall greater care around making the diagnosis during the pandemic (e.g. greater consultant involvement, greater use of imaging, higher threshold for undertaking surgery owing to COVID risks) and that this has contributed to this positive outcome. Furthermore, there was a greater proportion of children being treated by specialist paediatric surgeons in the pandemic cohort however the statistically significant differences in outcomes comparing these children to the pre-pandemic cohort are the same when just including children treated by SPS (supplementary table). Therefore, these data don't support that children treated by SPS have better outcomes.
Laparoscopic appendicectomy in children has been shown to reduce incidence of wound infection, reduce post operative ileus and shorten inpatient stay compared to open surgery [
• Jaschinski T.
• Mosch C.G.
• Eikermann M.
• et al.
Laparoscopic versus open surgery for suspected appendicitis.
,
• Aziz O.
• Athanasiou T.
• Tekkis P.P.
• et al.
Laparoscopic versus open appendectomy in children: a meta-analysis.
. Usage of laparoscopy was high in the cohort of children from the RIFT study however in the first two weeks of the COVID-19 pandemic only 25% were undertaken laparoscopically. This was likely in response to guidance from professional bodies that laparoscopy may increase the risk of SARS-CoV-2 transmission to healthcare staff in positive cases [
• De Simone B.
• Chouillard E.
• Di Saverio S.
• et al.
Emergency surgery during the COVID-19 pandemic: what you need to know for practice.
]. As the pandemic progressed laparoscopy was utilised more with a shift back to normal practice as guidance from professional bodies was updated and there was a greater understanding about the epidemiology of COVID-19 in children [

Munro A.R., D. The missing link? children and transmission of SARS-CoV-2. https://dontforgetthebubbles.com/the-missing-link-children-and-transmission-of-sars-cov-2/ (accessed 22/06/2020).

]. As many as 88% of children were being treated with laparoscopic appendicectomy at the end of the study (last 2 weeks of July) which is one of the highest rates reported in children. Maintaining this high rate of laparoscopy will mean that children receive appropriate evidence based treatment.
A further positive finding is that the readmission rate for cases treated surgically was lower during the pandemic than in the pre pandemic cohort. These findings hold true for both simple and complicated appendicitis. The reason for this difference is not immediately clear but we postulate that greater consultant involvement in cases may have been contributory and anecdotally we are aware of this practice. Of note this may have been at the expense of a slightly longer hospital stay during the pandemic.
This study is strengthened by the fact that data have been collected prospectively from multiple centres from across the United Kingdom and Ireland. We deliberately did not involve other international centres so as to achieve a region across which there is relative consistency in management of children with appendicitis. This is a pragmatic real world study and provides an overview of real life outcomes outside the confines that would typically be achieved in a clinical trial. Conversely some may view this pragmatism as a weakness since we have not used precise definitions for severity of appendicitis nor have we proposed criteria for different treatment strategies. We recognise that we have only reported outcomes to 30 days and plan further analysis to include longer term follow-up, particularly of the group of children managed thus far without surgery.
The COVID-19 pandemic has had a marked impact on the management of children with appendicitis with clear shifts towards increased use of non operative treatment and open (as opposed to laparoscopic) appendicectomy compared to a pre pandemic cohort in 2017. However, patient-important outcomes have not been greatly altered during the pandemic and the negative appendicectomy rate is particularly low. These data should reassure surgeons about the management strategy used during the pandemic in the face of restrictions to normal surgical services, may inform practice in future times of limited surgical capacity and should reassure the public and commissioners that the surgical workforce has continued to deliver high quality care in these difficult times.

## Funding

No funding was received for this research.

## Declaration of Competing Interest

All authors confirm that there are no competing interests.

## Acknowledgment

CASCADE study steering and writing group
George S Bethell (Southampton Children's Hospital and University of Southampton, Southampton, UK), Tom Gosling (University of Southampton, Southampton, UK), Clare M Rees (Imperial College Healthcare NHS Trust, London, UK), Jonathan Sutcliffe (Leeds Teaching Hospitals NHS Trust, Leeds, UK), Nigel J Hall (Southampton Children's Hospital and University of Southampton, Southampton, UK)

## References

• Giuliani S.
• Cecil E.V.
• Apelt N.
• et al.
Pediatric emergency appendectomy and 30-day postoperative outcomes in district general hospitals and specialist pediatric surgical centers in england, april 2001 to march 2012: retrospective cohort study.
Ann Surg. 2016; 263: 184-190
• De Simone B.
• Chouillard E.
• Di Saverio S.
• et al.
Emergency surgery during the COVID-19 pandemic: what you need to know for practice.
Ann R Coll Surg Engl. 2020; 102: 323-332
1. Joint guidance for surgeons: guidance for surgeons working during the COVID-19 pandemic from the Surgical Royal Colleges of the United Kingdom and Ireland. Royal College of Surgeons of England. https://www.rcseng.ac.uk/coronavirus/joint-guidance-for-surgeons-v1/, 2020.

• Collaborative C.
Mortality and pulmonary complications in patients undergoing surgery with perioperative SARS-CoV-2 infection: an international cohort study.
Lancet. 2020; 396: 27-38
• Bethell G.S.
• Rees C.M.
• Sutcliffe J.R.
• et al.
Management and early outcomes of children with appendicitis in the UK and Ireland during the COVID-19 pandemic: a survey of surgeons and observational study.
BMJ Paediatr Open. 2020; 4e000831
• Sherratt F.C.
• Allin B.S.R.
• Kirkham J.J.
• et al.
Core outcome set for uncomplicated acute appendicitis in children and young people.
Br J Surg. 2020; 107: 1013-1022
• Collaborative RSGobotWMR
Appendicitis risk prediction models in children presenting with right iliac fossa pain (RIFT study): a prospective, multicentre validation study.
Lancet Child Adolesc Health. 2020; 4: 271-280
• von E.E.
• Altman D.G.
• Egger M.
• et al.
The Strengthening the Reporting of Observational Studies in Epidemiology (STROBE) statement: guidelines for reporting observational studies.
J Clin Epidemiol. 2008; 61: 344-349
• Tiboni S.
• Bhangu A.
• Hall N.J.
Outcome of appendicectomy in children performed in paediatric surgery units compared with general surgery units.
Br J Surg. 2014; 101: 707-714
• Minneci P.C.
• Mahida J.B.
• Lodwick D.L.
• et al.
Effectiveness of Patient Choice in Nonoperative vs Surgical Management of Pediatric Uncomplicated Acute Appendicitis.
JAMA Surg. 2015; : 1-8
• Armstrong J.
• Merritt N.
• Jones S.
• et al.
Non-operative management of early, acute appendicitis in children: is it safe and effective?.
J Pediatr Surg. 2014; 49: 782-785
• Gorter R.R.
• van der Lee J.H.
• Cense H.A.
• et al.
Initial antibiotic treatment for acute simple appendicitis in children is safe: short-term results from a multicenter, prospective cohort study.
Surgery. 2015; 157: 916-923
2. Donnelly L. Women needlessly having their appendix out in almost one in three cases. The Daily Telegraph.

• Jaschinski T.
• Mosch C.G.
• Eikermann M.
• et al.
Laparoscopic versus open surgery for suspected appendicitis.
Cochrane Database Syst Rev. 2018; 11CD001546
• Aziz O.
• Athanasiou T.
• Tekkis P.P.
• et al.
Laparoscopic versus open appendectomy in children: a meta-analysis.
Ann Surg. 2006; 243: 17-27
3. Munro A.R., D. The missing link? children and transmission of SARS-CoV-2. https://dontforgetthebubbles.com/the-missing-link-children-and-transmission-of-sars-cov-2/ (accessed 22/06/2020).

format: plain


text:
# Express the matrix A = [(3,-4)(1,-1)]  as the sum of a symmetric matrix and a skew-symmetric matrix.

98 views
in Matrices
closed

Express the matrix A = $\begin{bmatrix} 3 & -4 \\[0.3em] 1& -1 \\[0.3em] \end{bmatrix}$ as the sum of a symmetric matrix and a skew-symmetric matrix.

A = [(3,-4)(1,-1)]

+1 vote
by (31.5k points)
selected by

Given A = $\begin{bmatrix} 3 &-4 \\[0.3em] 1& -1 \\[0.3em] \end{bmatrix}$, to express as the sum of symmetric matrix P and skew symmetric matrix Q.

A = P + Q

Where P = $\frac{1}{2}$(A + A') and Q = $\frac{1}{2}$(A - A'), we will find transpose of matrix A

A' = $\begin{bmatrix} 3 &1 \\[0.3em] -4& -1 \\[0.3em] \end{bmatrix}$

Now using the above formulas

Hence A = P + Q

$\Rightarrow$ $\begin{bmatrix} 3 &-4 \\[0.3em] 1& -1 \\[0.3em] \end{bmatrix}$


text:
Annals of Statistics

Completely Separating Groups in Subsampling

Louis Gordon

Abstract

We study several combinatorial problems related to the choice of groups of subsets to be used in the subsampling procedure of Hartigan (J. Amer. Statist. Assoc. 1969). The complete separation property is shown to guarantee asymptotic efficiency relative to $t$. Problems associated with the relative variance criterion are discussed.

Article information

Source
Ann. Statist., Volume 2, Number 3 (1974), 572-578.

Dates
First available in Project Euclid: 12 April 2007

https://projecteuclid.org/euclid.aos/1176342719

Digital Object Identifier
doi:10.1214/aos/1176342719

Mathematical Reviews number (MathSciNet)
MR362695

Zentralblatt MATH identifier
0323.62008

JSTOR


text:
# Organise Entities in a 2D Game

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

## Recommended Posts

Hey guys,

I'm currently working on a 2D strategy game with a two dimensional grid but i wonder if my current approach of organising entities is suitable or could be improved. Im using C++(11) and SFML.

The map's size will be about 400*400 fields. I divided it into smaller chunks (~40*40) and will only render the corresponding ones.

These are the requirements of my container:

- insert / delete objects (seldom)

- change values of existing objects (often)

- access by coordinates

Therefore i chose a std::list to store unique_ptrs on the entitie's instance because inserting/deleting objects in a list is easier,

and another container with pointers on the unique_ptr pointers to access them without iterating through the whole list.

This is the second container:

std::vector<std::vector<std::vector<std::unique_ptr<mapObject>*>>> mMapObjectPointers;

-> mMapObject[X][Y][Multiple Objects on this field]

All Entities are derived from "mapObjects". I think there will be 400-2000 entities in total, that's why im trying to avoid using a search algorithm.

I'm pretty new to game programming and just want to improve my skills So please feel free to give a constructive criticism.

(I read two books, a basic one and the "SFML Game Development"-Book, and serveral tutorials on the internet, but couldn't find any solution to a smiliar problem. If you have good articles about this topic, feel free to post it.)

##### Share on other sites

Therefore i chose a std::list to store unique_ptrs on the entitie's instance because inserting/deleting objects in a list is easier,
and another container with pointers on the unique_ptr pointers to access them without iterating through the whole list.

std::list is a linked list implementation. It's optimized for frequent insertion/deletion (something you say is seldom). They are "relatively" slow for iteration due to cache misses - the nodes can be scattered around various places in memory. 400-2000 entities is few enough that it probably won't matter though (not to mention your map objects appear to be allocated from the heap too, so they'll be scattered about memory). By default I would have just used a vector based on your requirements, but list will probably be fine too.

This is the second container:

std::vector<std::vector<std::vector<std::unique_ptr<mapObject>*>>> mMapObjectPointers;
-> mMapObject[X][Y][Multiple Objects on this field]

Are these supposed to be the same objects than those in your std::list? If so, you can't use unique_ptr here, they should be raw pointers instead (and lifetime ownership is controlled by the unique_ptrs in your master std::list). unique_ptr implies (unique) ownership.

And assuming your map is not dynamically resizable during gameplay, you should just use a fixed array, not a vector of vectors.

In fact, if your gameboard is 400x400, that's 160000 squares, and you only have 400-2000 entities. So most of those squares are empty. At most, 1.25% are occupied. I would be tempted to use some sort of sparse storage instead, i.e. only store a vector of objects where there is a square with objects in it. You could use an associative container like std::unordered_map for this. They key would be the [x,y] coordinate (you'll need to provide a custom hash function for this, or merge the two coordinates into a single int or something), and the value would be a vector of raw mapObject pointers.

Alternatively, you could store the [x,y] coordinate on mapObject and implement some kind of spatial partitioning to allow finding an object quickly by [x,y].

Edited by phil_t

##### Share on other sites

Why only one?

Most games have multiple representations of the game objects with only one copy of the main object itself.  Pointers are great.

Typically this means large pools of assets -- your main collection of entities.  These don't move around, but the data in them changes.

Then you can build other tools and collections that work with pointers to these objects.

Then your spatial grid might be a loose quadtree that has pointers back to the primary objects. When an object moves the function that handles movement can update both the spatial tree information and the object's internal position details.  It also allows you to build objects that don't exist on the spatial tree.

Games will often have several types of these trees.  A tree for physics, a similar but different tree for pathfinding and object footprints, a similar but different tree for rendering and occlusion culling, and so on.

##### Share on other sites

These are the requirements of my container:
- insert / delete objects (seldom)
- change values of existing objects (often)
- access by coordinates

Access by coordinates could easily be wrapped into a function. Since it's possible that there are multiple objects at a specific coordinate, you can write a function like:

std::vector<Object*> objectsAtLocation = GetObjectsAtLocation(mapData, location);

...looking up all the objects at a specific map cell in a single iteration of the array. 2000 is a small amount.

Therefore i chose a std::list to store unique_ptrs on the entitie's instance

Why unique pointers within a container? The container already manages the memory for you, using unique_ptrs is redundant - unless you are using polymorphism, in which case, pointers/unique_ptrs inside a container is necessary.

Therefore i chose a std::list to store unique_ptrs on the entitie's instance because inserting/deleting objects in a list is easier,

But you said you insert/delete objects seldomly, so use a vector, and write a couple of helper functions for insertion/deletion.

Does the order of the elements in the container matter? If not, swap-and-pop them - it's very efficient.

This is the second container:
std::vector<std::vector<std::vector<std::unique_ptr<mapObject>*>>> mMapObjectPointers;
-> mMapObject[X][Y][Multiple Objects on this field]

struct MapCell
{
std::vector<std::weak_ptr<Object>> objects; //Non-owning pointers.
};

std::vector<MapCell> map;
map.resize(MapWidth * MapHeight);

Use a one-dimensional array, and treat it as two-dimensional when you need to.

Like this:

size_t index = (y * MapWidth) + x;
map[index] = ...;

All Entities are derived from "mapObjects". I think there will be 400-2000 entities in total

400-2000 entities per map, sharing two or three derived classes?

that's why im trying to avoid using a search algorithm.

When learning, just do the simplest thing that works until it no longer works fast enough. When I don't have experience, it's easier for me to get caught up in "Oh, I need some super uber clever way of doing things, because certainly doing it the brute force way would be too slow...", but computers nowadays are ridiculously powerful, and 2000 entities is still a tiny amount.

You can probably find your elements quick enough by iterating over each element in the array but, if not, you can easily look into alternative optimizations at that point in development, and at this point in development focus on making the game logic. Programmers are notoriously bad at predicting what parts of our code will be the bottlenecks - which is why we've invented tools (profilers) to tell us.

You don't need to do your logic every frame - you do rendering (drawing) every frame, but logic only X times a second, or logic only in response to certain actions.

##### Share on other sites
Are these supposed to be the same objects than those in your std::list? If so, you can't use unique_ptr here, they should be raw pointers instead (and lifetime ownership is controlled by the unique_ptrs in your master std::list). unique_ptr implies (unique) ownership.

No. My idea was to have unique_ptrs in the list to control theire lifetime, and the vector should contain raw pointers on the unique_ptrs.

Why unique pointers within a container? The container already manages the memory for you, using unique_ptrs is redundant - unless you are using polymorphism, in which case, pointers/unique_ptrs inside a container is necessary.

Yes. I'm using polymorphism.

400-2000 entities per map, sharing two or three derived classes?

I'm using the following structure:

mapObject

-> structure

-> town

- >...

-> movable

-> army

-> ...

Does the order of the elements in the container matter? If not, swap-and-pop them - it's very efficient.

No, it doesn't matter. But it could matter, when i would take another approach, f.ex. quicksort for coordinates.

And assuming your map is not dynamically resizable during gameplay, you should just use a fixed array, not a vector of vectors.

Yes it has a fixed size.

As a result of your answers, i will rethink my storage and will probably change it to an one-dimensional structure and use a suitable search-algorithm. I don't think that there will be much more than 2000 entities, maybe the map will be smaller. So this seems to be the better approach!

Quote

This is the second container:
std::vector<std::vector<std::vector<std::unique_ptr<mapObject>*>>> mMapObjectPointers;
-> mMapObject[X][Y][Multiple Objects on this field]

Could you explain, why a 3D/2D vector is an unfavourable?

##### Share on other sites

No. My idea was to have unique_ptrs in the list to control theire lifetime, and the vector should contain raw pointers on the unique_ptrs.

If all you need it a bag to hold onto references for lifetimes, a vector is almost the definition of what you need. A std::list is almost always the utterly wrong data structure to use; in the cases where a linked list is right, a std::list is still wrong. Just forget that it ever existed. While you're at it, forget std::map and std::set, too, and prefer unordered_map, unordered_set, or boost's flat_map and flat_set.

I'm using the following structure:
mapObject
-> structure
-> town
- >...
-> movable
-> army
-> ...

Why not have separate arrays/vectors for towns and armies? They have very little overlap in purpose or functionality in most games I'm familiar with compared to the amount of functionality that differs between them, so using a single class hierarchy for both is usually a bad use of OOP.

If there is a good chunk of code that's the same, consider a further split, e.g. a vector of town data, a vector of army data, and then a vector of drawable map object data (and more vectors for any other discrete chunks of common functionality/data). That then also lets you add all kinds of other things that can be drawn that are utterly unlike towns or armies, which may be useful. This approach is a form of component-based design.

Could you explain, why a 3D/2D vector is an unfavourable?

A vector-of-vectors is _not_ a 2D vector. A 2D structure would have a height and a width. A vector-of-vectors has a height and many (possibly all different) widths. These widths can get out of sync in cases where you really need them to be the same. The structure overall is not contiguous in memory. There's some mild overhead in tracking all the vector state for each row.

##### Share on other sites

What Sean said.

Could you explain, why a 3D/2D vector is an unfavourable?

Sure. First, let me clarify: I had two nested, abd you had three vectors nested, but speaking of the code logic, you had a "2D" vector of map cells (and each map cell had a vector), and I had a "1D" vector of map cells, and each map cell had a vector. I'm not arguing against each cell containing a vector.

Also, let me clarify that the "ouch" comment was the declaration:

std::vector<std::vector<std::vector<std::unique_ptr<mapObject>*>>> mMapObjectPointers;

I find that not very legible. Even if I was using the same thing, I'd rewrite it to show code intention more.

struct MapCell
{
std::vector<std::unique_ptr<MapObject*>> objects;
};

typedef std::vector<std::vector<MapCell>> MapCells;
MapCells mapCells;

Virtually the same thing (only one minor usage difference), just easier for me personally to read, especially when passing into functions by reference.

Alrighty, onward! So, setting aside the map cells, what's the differences between using:

std::vector<int> blah(Width*Height);

And:

std::vector<std::vector<int>> blah;

First, an std::vector<std::vector<>> isn't a 2D array. It's an array-of-arrays. This means that each "row" can be a different length... it doesn't enforce squareness/rectangleness! This is especially significant if you resize the arrays (for example, different maps having difference sizes) - you have to make sure you resize all of them; you have to keep them in sync.

Second, remember that std::vector<> allocates and manages a chunk of memory for you. Doing std::vector<std::vector<>> means you are allocating many smaller chunks of memory scattered throughout the RAM, instead of one chunk of memory (adding up to the same amount, total) in one location in the RAM. This *might* be slower, in some circumstances. In this situation, I wouldn't worry about it at all, as it probably doesn't matter in your case, but it's important to know as a "difference" between them.

Third, there are benefits to 1D vectors, and benefits to 2D vectors.
Now, let's suppose you had a class that actually was a 2D vector. We'll call it std::vector2D<> instead (no standard like that exists, but it'd be very easy to make).

The 1D benefits are, you can iterate from one end to the other really easily:

for(int i  = 0; i < vector.size(); ++i) //Alternatively: for(Type &type : vector)
{
vector[i] = ...;
}

To do the same in 2D, you do:

for(int x = 0; x < width; ++x)
{
for(int y = 0; y < width; ++y)
{
vector[x][y] = ...;
}
}

More code for doing the same thing.

The benefit 2D arrays are indexing into them with 'x' and 'y', it more closely matches the mental model of your 2D board.

myMap[x][y] = ...;

But you can do the same thing with 1D arrays, by treating them as if they were 2D arrays:

myMap[(y * width) + x] = ....;

The limitations (fragmentation of memory, manually keeping the row lengths in sync, extra code merely to iterate over every element) get worse and worse for each additional dimension you add. Three dimensions, four dimensions, whatever.

But you can treat a 1D array like an array of any number of dimensions you want, just by indexing into it how you like:

myMap[(z * width * height) + (y * width) + x] = ....; //Three dimensions

And you can wrap up the indexing into a helper function if you like.

Our memory (RAM) is one dimensional. Any 2D or 3D arrays are just mapping the indices to a 1D set of memory, the same way we are. Here, we're taking finer control over it so it maps the way we want, and so we can switch between 1D and 2D when we need (which we often do!).


text:
I've been trying to wrap my head around cointegration. Currently I use the log returns of both stocks A and B, calculate the spread given by:

$$S = log(A) - n*log(B)$$ where $$n$$ is the Hedge Ratio calculated from a rolling OLS. In the results I've read I've operated under the assumption that if the spread falls below a certain point then long A and short B and vice versa. I believe this is a dollar neutral hedge?

My confusion lies in the Hedge ratio part whereby I'm not sure how to interpret it. I've seen an example that says long A and short $$n$$ stocks of B. However, I sometimes get negative values of $$n$$, i.e log returns are inversely correlated. How do I interpret this?

• A negative $n$ would mean that the stocks are diverging. In that case you don't want to pair trade them. – noob2 May 8 at 19:52
• @noob2 I don't think so. It just means you want to short negative amount of stock = going long both A and B. This is common with say inverse ETFs, but could be a sign of unstable regression coefficients for the ordinary stocks. – LazyCat May 12 at 13:10


text:
# Seaborn barchart for frequency of data

I'm trying to plot a bar chart to represent the frequency of two variables (Dead and Alive) in my test and training data. I want it to look like the second example described in the documentation (minus the error bars).

Currently i have

yfreq = pd.DataFrame(data = [Counter(Ytrain),Counter(Ytest)],
index = ['Train','Test'])
print(yfreq)
Train   384    239
Test    165    103

And then for the graph

sns.barplot(data = yfreq)

Which correctly outputs a graph but does not split the data into test and training data.

I know it has something to do with the hue kwarg but i can't work out how too do it.

yfreq['type'] = yfreq.index


text:
# On the only eigen value of complex matrix.

If suppose I have a square matrix with complex entries with all its eigen value say, $\lambda$ which is real, than what are the possibility of such a matrix. Now, if $\lambda$ is the only real eigen value than by Cayley-Hamilton Theorem we can conclude that $$(A-\lambda I )^n = 0$$ . Can we also say $$A^n = \lambda^n I$$.

• It's a nilpotent matrix – Tutankhamun Dec 12 '17 at 4:19

$$A = \begin{bmatrix} \lambda & 1 \\ 0 & \lambda \end{bmatrix}.$$
Clearly, the only eigenvalue of $A$ is $\lambda$ but $A \ne \lambda I$.
If $A$ is diagonalizable, then indeed you may conclude that $A = \lambda I$. For then $A = P(\lambda I)P^{-1} = \lambda PP^{-1} = \lambda I$. However, if $A$ is not diagonalizable, then it will have $1$'s on the super diagonal of its Jordan form and as the above example shows, we cannot conclude $A = \lambda I$.


text:
# Issues using listings package [closed]

I am using LaTeX to write my internship report (I started to learn it one month ago), and I have some issues using the package listings. I'm not sure if everything is possible:

1. How can I add a specific highlighting to the code? I mean, I know how to colorize keywords or comments, but I want to add new characters or patterns (just like @, $1, $~2 for example). Please see attached file for more information.
2. How can I switch between two languages (and therefore two different syntax highlightings) in my report? For now, I just use command.com (aka batch WinXP =D), but what if I want to write C++ then, and just after, command.com again?
3. Then, my real problem: why do space characters become visibles at line 13 (see attachments)? To be specific, it start at line 12 when I use two double quotes (when I delete one everything is ok). I think LaTeX interprets everything as a string, but... it's not =D
4. Finally (and I think it will be tricky, and maybe impossible), is it possible to add my own language to those interpreted by listings? In my internship, I use mainly WLangage (by PCSoft), and of course it is not known by the listings package. Currently, I avoid the problem by setting my code into a typewriter environment and by using \textcolor{mycolor}{mykeyword}, which is not the best. I lost line numbers and tabulations.

To understand better, here is what I got after compilation:

And here is a minimal code of what I do:

\documentclass[10pt]{scrreprt}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[ansinew]{inputenc}
\usepackage[french]{babel}

\usepackage{fancyhdr}
\usepackage{numprint}
\usepackage{color}
\definecolor{bat-bg}{rgb}{.16,.19,.2}
\definecolor{bat-norm}{rgb}{.9,.9,.9}
\definecolor{bat-comm}{rgb}{.4,.45,.48}
\definecolor{bat-kw}{rgb}{.57,.78,.39}
\definecolor{bat-str}{rgb}{.2,.38,.62}

\usepackage{listings}

\lstset{
language={[WinXP]command.com},
basicstyle=\color{bat-norm}\footnotesize\ttfamily,
numbers=left,
numberstyle=\normalsize,
numbersep=7pt,
backgroundcolor=\color{bat-bg},
keywordstyle=\color{bat-kw},
numberstyle=\tiny\color{bat-bg},
stringstyle=\color{bat-str},
tabsize=2
}

\fancypagestyle{monstyle}{
% Things that define my style
% I don't really think that fancypagestyle is the cause of the problem, but I let it
}
\pagestyle{monstyle}

\begin{document}

\begin{lstlisting}
@echo off   rem désactive l’affichage des commandes
cls             rem efface les lignes précédentes

rem on envoie les paramètres dans des variables
rem l’ajout du tilde supprime les double quote entourantes ("")
set requestType=%1
set params=%~2
set url=%3
set redirect=%4

rem remplacement de "" par " et de #egal# par =
set params= %params:""="%
set url= %url:#egal#==%

curl -X "%requestType%" %params% %url% > %redirect%
\end{lstlisting}
\end{document}

## Update

I solved my issues.

To add specific highlighting to the code, I have to use morekeywords={my, new, keywords}, and to colorize it in an other way, I must write:

\lstdefinestyle{batch}{
language={[WinXP]command.com},
keywordstyle=\color{bat-kw},
keywords=[2]{@},
keywords=[3]{\%1,\%~2,\%3,\%4, \%params\%, \%url\%, \%redirect\%},
keywords=[4]{curl},
keywordstyle=[2]\color{bat-at},
keywordstyle=[3]\color{bat-str},
keywordstyle=[4]\color{bat-cmd}
}

And now, I know how to switch between two languages: I have to define two styles, and then use them when doing listings: \begin{lstlisting}[style=MyOtherStyle]

And finally, to escape my double quote, I can write escapechar={°} in the \lstset and then, escape the quote in the \begin{lstlisting} with °\color{mycolor}{"}°.

## closed as unclear what you're asking by jubobs, Masroor, henrique, dustin, Benedikt BauerMay 23 '14 at 18:00

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• Welcome to TeX.SX! Switching the language is done by \begin{lstlisting}[language=A] where A means a language of your choice – user31729 May 23 '14 at 7:33
• Thanks @ChristianHupfer! I knew about the option [language=A], but since I use a \lstset, I would have wanted to change the colors of the syntax highlighting depending on the language I use. – bjorge May 23 '14 at 8:01
• Welcome to TeX.SX! You don't have to sign with your name since it automatically appears in the lower right corner of your post. You seem to be asking several unrelated questions, here. On TeX.SX, we try to keep unrelated questions on separate pages. In the future, if you have multiple questions that are unrelated to one another, you should ask each in a separate TeX.SX "question". You'll stand a better chance of getting a satisfactory answer to each of your questions. – jubobs May 23 '14 at 9:47
• Thank you @Jubobs! I signed with my name because when I posted first, it was user### =D Now I updated it. I also will remember to ask unrelated questions on separated pages in the future, for now I solved my main issue with listings documentation, 4.14 Escaping to LATEX, I hope it will help other people! – bjorge May 23 '14 at 9:58
• Please update your question to reflect what the remaining problems are. – jubobs May 23 '14 at 10:01


text:
Home > PC3 > Chapter 4 > Lesson 4.3.2 > Problem4-126

4-126.

Write an equation for an exponential function of the form $y=a·b^x$ that passes through the points $(2,18)$ and $(4,162)$. The steps of the process are outlined below if you need them.

1. Write a system of two equations by replacing $x$ and $y$ with the coordinates of the two given points.

$18=a·b^2$

2. Solve for $a$ in terms of $b$ in one equation. Substitute this value into the other equation to obtain one equation with a single variable, $b$.

$a=\frac{18}{b^2}$

3. Solve your equation from part (b) for $b$.

4. Use the value of $b$ from part (c) to determine the value of $a$.

5. Write the final equation.


text:
Get to know how and where to get TeX distributions for Linux, Mac OS, and LaTeX online services like Papeeria, Overleaf, ShareLaTeX, Datazar, and LaTeX base offer the ability to edit, view and download LaTeX files and resulting PDFs. JavaScript 12.3%. Branch: master. New pull request. Find file. Clone or download config · Move web-sharelatex back to master branch. 3 years ago. Jul 5, 2018 Before addressing what a LaTeX editor is, let us see what TeX and LaTeX are. ShareLaTeX is a web-based LaTeX writing and collaboration tool which download your project in a ZIP file and work on it offline via your TeX  To work with LaTeX, you'll need a way of compiling your .tex files to PDFs. A lot of people at CMU use an online LaTeX client called ShareLaTeX. It's a huge (2.4GB) download, but it contains everything you need to do LaTeX offline. there was a program that I can download which has fast compilation time and split I expect you have TeXworks in your distribution? cd Library/texmf/tex/ && \ mkdir latex && \ cd latex && \ wget I use it to automatically generate .tex files. Mar 17, 2019 A screenshot of local ShareLaTeX server with full texlive package installed. Tex file available in GithubGist. If you use You may need to download mongoDB client first with sudo apt install mongodb-clients . Then, we can

## Knitr is very easy to implement in ShareLatex (basically you name your file .Rtex instead of .tex). On the author Yihui Xie's site, he also explains how to use it on Texmaker and even RStudio.

Latex Cookbook - Sample Chapter - Free download as PDF File (.pdf), Text File (.txt) or read online for free. Chapter No.1 The Variety of Document Types Over 90 hands-on recipes for quickly preparing LaTeX documents to solve various… To set up a basic TeX/LaTeX system, download and run the Basic Miktex Installer. extra_packages: A character vector of extra LaTeX packages to be installed.

### In rare cases, compiling larger Tex files results in an Internal Server Error. of templates available at sharelatex.com which can be downloaded as a ZIP file and

Then you include TeX language. TeX tells LaTeX how you want your document to be formatted (we discuss some TeX in step 2). Finally, you confirm the compiling option in LaTeX. LaTeX then compiles your TeX into a text file (e.g. Deploy LaTeX (and Markdown) Documents as PDF (and DjVu) via GitHub and TravisCI - SimonWaldherr/HowTo-Deploy-LaTeX-Documents Many users drop in to TeX.Stackexchange. The support for LaTeX-templates is done in collaboration with LaTeX-community, though not everybody finds the right button and many users seek help at TeX.SX. Ultimate Latex Makefile intended to work with a large bunch of pdfs. - janzhou/latex-makefile A demonstration of using Github to collaborate on academic papers, via a pandoc script triggered by a post-receive hook. - sheppard/github-paper-collaborator Repository for Master Thesis. Contribute to dmpe/master development by creating an account on GitHub.

### About ShareLaTeX. MikTeX is simple to install - just go to the MikTeX Homepage and download a (basic system or complete system) setup wizard.

Here is what I wrote in my test.tex file: Code: [Select all] [Expand/Collapse] [Download] (untitled.tex). \documentclass{article}. \begin{document}. users of LATEX v2.09 layered on TEX v2.0. .toc file. \addtocounter{name}{amount} adds amount to counter name. from file name.bib at this point in text. Key–Words: Animation in pdf, IrfanView, ShareLaTex, smartpen note, LATEX. 1 Introduction Some sites such as [19] provide source file (Tex) with the output  Oct 25, 2011 This generates one .bib file for each folder you create in Mendeley Desktop. BibTeX LaTeX (.tex) file with citations added in dummy text  ShareLaTeX provides a pre-configured configuration file that can be used with docker-compose. 1 . Create a directory and download the file:. The file will appear in your folder as 'Hello.tex.' We will call this the source file. In order to create a finished LaTeX document, we need to compile the source file.


text:
## Found 774 Documents (Results 1–100)

100
MathJax

### A parallel-in-time multiple shooting algorithm for large-scale PDE-constrained optimal control problems. (English)Zbl 07517750

MSC:  90Cxx 65Kxx 49Mxx
Full Text:

Full Text:

### Computation of nonlinear thermal radiation in magnetized nanofluid flow with entropy generation. (English)Zbl 07488777

MSC:  76Rxx 76Wxx 76Mxx
Full Text:

Full Text:

Full Text:

### Numerical computation of third order delay differential equations by using direct multistep method. (English)Zbl 1483.65113

MSC:  65L03 65L06 65L10
Full Text:

Full Text:

Full Text:

Full Text:

Full Text:

Full Text:

Full Text:

### Combining the shooting method with an operational matrix method to solve two point boundary value problems. (English)Zbl 07486467

MSC:  65L05 65L10
Full Text:

### Numerical methods for the optimal control of the heel angle of a rocket. (English)Zbl 07468414

MSC:  49M99 49K15 90C30
Full Text:

### On determination of the thermomechanical characteristics of a functionally graded finite cylinder. (English. Russian original)Zbl 1481.74143

Mech. Solids 56, No. 7, 1429-1438 (2021); translation from Prikl. Mat. Mekh. 85, No. 3, 396-408 (2021).
Full Text:

Full Text:

Full Text:

### A shooting approach to the scaled boundary finite element equations of elastodynamics in the frequency domain. (English)Zbl 07427405

MSC:  74-XX 65-XX
Full Text:

### A general solution procedure for the scaled boundary finite element method via shooting technique. (English)Zbl 07415278

MSC:  65-XX 74-XX
Full Text:

Full Text:

### Solving the singularly perturbation problems of delay differential equations numerically. (English)Zbl 1469.65131

MSC:  65L11 34K26 65L06
Full Text:

### Direct integration of the third-order two point and multipoint Robin type boundary value problems. (English)Zbl 07318264

MSC:  34Bxx 65Lxx 34Axx
Full Text:

### Time-optimal control problem with state constraints in a time-periodic flow field. (English)Zbl 1472.49008

Jaćimović, Milojica (ed.) et al., Optimization and applications. 10th international conference, OPTIMA 2019, Petrovac, Montenegro, September 30 – October 4, 2019. Revised selected papers. Cham: Springer. Commun. Comput. Inf. Sci. 1145, 340-354 (2020).
MSC:  49J21 49M99
Full Text:

Full Text:

Full Text:

### On the smoothness of nonlinear system identification. (English)Zbl 1448.93064

MSC:  93B30 93C10
Full Text:

Full Text:

Full Text:

Full Text:

Full Text:

Full Text:

Full Text:

Full Text:

Full Text:

### A modified integral discretization scheme for a two-point boundary value problem with a Caputo fractional derivative. (English)Zbl 1425.65074

MSC:  65L05 65L12 65L20
Full Text:

Full Text:

Full Text:

Full Text:

### MHD Carreau fluid flow past a melting surface with Cattaneo-Christov heat flux. (English)Zbl 1445.80001

Kumar, B. Rushi (ed.) et al., Applied mathematics and scientific computing. International conference on advances in mathematical sciences, ICAMS, Vellore, India, December 1–3, 2017. Volume II. Selected papers. Cham: Birkhäuser. Trends Math., 325-336 (2019).
Full Text:

### Chemically reactive 3D nonlinear magneto hydrodynamic rotating flow of nanofluids over a deformable surface with Joule heating through porous medium. (English)Zbl 1448.76180

Kumar, B. Rushi (ed.) et al., Applied mathematics and scientific computing. International conference on advances in mathematical sciences, ICAMS, Vellore, India, December 1–3, 2017. Volume II. Selected papers. Cham: Birkhäuser. Trends Math., 313-323 (2019).
Full Text:

### Stratification and cross diffusion effects on magneto-convection stagnation-point flow in a porous medium with chemical reaction, radiation, and slip effects. (English)Zbl 1445.80007

Kumar, B. Rushi (ed.) et al., Applied mathematics and scientific computing. International conference on advances in mathematical sciences, ICAMS, Vellore, India, December 1–3, 2017. Volume II. Selected papers. Cham: Birkhäuser. Trends Math., 245-253 (2019).
Full Text:

### MHD and cross diffusion effects on peristaltic flow of a Casson nanofluid in a duct. (English)Zbl 1450.76002

Kumar, B. Rushi (ed.) et al., Applied mathematics and scientific computing. International conference on advances in mathematical sciences, ICAMS, Vellore, India, December 1–3, 2017. Volume II. Selected papers. Cham: Birkhäuser. Trends Math., 191-201 (2019).
Full Text:

### MHD three dimensional Darcy-Forchheimer flow of a nanofluid with nonlinear thermal radiation. (English)Zbl 1445.80005

Kumar, B. Rushi (ed.) et al., Applied mathematics and scientific computing. International conference on advances in mathematical sciences, ICAMS, Vellore, India, December 1–3, 2017. Volume II. Selected papers. Cham: Birkhäuser. Trends Math., 87-97 (2019).
Full Text:

Full Text:

Full Text:

### Optimal control of counter-terrorism tactics. (English)Zbl 1428.49031

MSC:  49M05 65K10 91F10
Full Text:

### Two-phase Couette flow of couple stress fluid with temperature dependent viscosity thermally affected by magnetized moving surface. (English)Zbl 1425.76278

MSC:  76T20 76W05 76M25
Full Text:

### Two point diagonally block method for solving boundary value problems with Robin boundary conditions. (English)Zbl 1437.65078

MSC:  65L10 65L20
Full Text:

Full Text:

### Interval structure of Runge-Kutta methods for solving optimal control problems with uncertainties. (English)Zbl 1449.49010

MSC:  49J30 65G40 65L06
Full Text:

### Upshot of ohmically dissipated Darcy-Forchheimer slip flow of magnetohydrodynamic sutterby fluid over radiating linearly stretched surface in view of Cash and Carp method. (English)Zbl 1416.76341

MSC:  76W05 76A05 76M25
Full Text:

### Existence proof of unimodal solutions of the Proudman-Johnson equation via interval analysis. (English)Zbl 1410.76332

MSC:  76M25 35Q35 76D99 65G20
Full Text:

Full Text:

### Minimization fuel rate of an aircraft. (English)Zbl 1431.49023

MSC:  49K15 49J45
Full Text:

### Adaptive multiple shooting for nonlinear boundary value problems. (English)Zbl 1431.65113

Radu, Florin Adrian (ed.) et al., Numerical mathematics and advanced applications. ENUMATH 2017. Selected papers based on the presentations at the European conference, Bergen, Norway, September 25–29, 2017. Cham: Springer. Lect. Notes Comput. Sci. Eng. 126, 951-959 (2018).
MSC:  65L10 65L50 34B15
Full Text:

Full Text:

Full Text:

Full Text:

Full Text:

### Combined effects of frictional and joule heating on MHD nonlinear radiative Casson and Williamson ferrofluid flows with temperature dependent viscosity. (English)Zbl 1420.76008

MSC:  76W05 76A05 76M55 76M20 80A20
Full Text:

Full Text:

MSC:  65Lxx
Full Text:

Full Text:

### A hybrid direct-indirect approach for solving the singular optimal control problems of finite and infinite order. (English)Zbl 1397.49041

MSC:  49M20 49M25
Full Text:

### Global optimal control with the direct multiple shooting method. (English)Zbl 1402.49005

MSC:  49J15 49M30 49K40 49J45
Full Text:

Full Text:

### Shooting methods for state-dependent impulsive boundary value problems, with applications. (English)Zbl 1397.65108

Reviewer: Yang Yang (Wuxi)
MSC:  65L10 34B37
Full Text:

Full Text:

Full Text:

### Radial positive solutions for $$p$$-Laplacian supercritical Neumann problems. (English)Zbl 1439.35178

“Bruno Pini” Mathematical Analysis Seminar 2017. Papers from the seminar, University of Bologna, Bologna, Italy, 2017. Bologna: Università di Bologna, Alma Mater Studiorum. 55-72 (2017).
Full Text:

### Study of predictor corrector block method via multiple shooting to Blasius and Sakiadis flow. (English)Zbl 1426.76553

MSC:  76M25 65L06 76D10
Full Text:

Full Text:

Full Text:

Full Text:

### Well-posedness and numerical approximation of tempered fractional terminal value problems. (English)Zbl 1377.65083

MSC:  65L05 34A08 34A34
Full Text:

Full Text:

Full Text:

### Numerical analysis of ordinary differential equations. Vol. 1: Initial value problems and linear boundary value problems. 2nd revised edition. (Numerik gewöhnlicher Differentialgleichungen. Band 1: Anfangswertprobleme und lineare Randwertprobleme.) (German)Zbl 1379.65045

De Gruyter Studium. Berlin: De Gruyter (ISBN 978-3-11-050036-3/pbk; 978-3-11-049888-2/ebook). x, 291 p. (2017).
Full Text:

### Solution of boundary value problems using two-point direct block method with one-off step point. (English)Zbl 1365.65189

MSC:  65L06 65L10
Full Text:

Full Text:

Full Text:

### A shooting like method for non-Darcian seepage flow problems. (English)Zbl 1398.76215

MSC:  76S05 76M25
Full Text:

### Numerical simulation methods for embedded optimization. (English)Zbl 1356.65158

Leuven: KU Leuven, Arenberg Doctoral Shool, Faculty of Engineering Science; Freiburg: Univ. Freiburg, Faculty of Mathematics and Physics (Diss. 2016). xxv, 293 p. (2017).
Full Text:

### Modeling and analysis of modern fluid problems. (English)Zbl 1396.76001

Mathematics in Science and Engineering. Amsterdam: Elsevier/Academic Press (ISBN 978-0-12-811753-8/pbk; 978-0-12-811759-0/ebook). xii, 467 p. (2017).
MSC:  76-02 76M45 76A05 76A10 76M25
Full Text:

### Numerical methods and parallel algorithms for computation of periodic responses of plates. (English)Zbl 1381.74209

MSC:  74S05 74K20 65M60
Full Text:

Full Text:

### Boundary layer flow and heat transfer on a moving plate in a copper-water nanofluid using Buongiorno model. (English)Zbl 1468.35126

Chen, Chuei Yee (ed.) et al., Innovations through mathematical and statistical research. Proceedings of the 2nd international conference on mathematical sciences and statistics, ICMSS2016, Kuala Lumpur, Malaysia, January 26–28, 2016. Melville, NY: American Institute of Physics (AIP). AIP Conf. Proc. 1739, Article ID 020021, 7 p. (2016).
Full Text:

Full Text:

Full Text:

### Matslise 2.0: a Matlab toolbox for Sturm-Liouville computations. (English)Zbl 1369.65094

MSC:  65L15 65L10 65Y15
Full Text:

### Numerical solution of MHD Sisko fluid over a stretching cylinder and heat transfer analysis. (English)Zbl 1356.76243

MSC:  76M25 76W05 76A05 76D10 80A20
Full Text:

Full Text:

Full Text:

Full Text:

### Numerical shooting methods for optimal boundary control and exact boundary control of 1-D wave equations. (English)Zbl 1346.93162

MSC:  93B40 35L05 65M06
Full Text:

### On the determination of optimal nodes and weight factors for the solution of completely incoherent scattering problem. (English)Zbl 1342.45007

MSC:  45G10 35Q20 65R20
Full Text:

### Heat flux performance in a porous medium embedded Maxwell fluid flow over a vertically stretched plate due to heat absorption. (English)Zbl 1342.35225

MSC:  35Q30 76D10 80A20 76A05 76A10 65L06 65L10
Full Text:

MSC:  65D18
Full Text:

Full Text:

### Nonlinear ordinary differential equations. Analytical approximation and numerical methods. (English)Zbl 1361.34001

New Delhi: Springer (ISBN 978-81-322-2810-3/hbk; 978-81-322-2812-7/ebook). xvi, 310 p. (2016).
Full Text:

all top 5

all top 5

all top 5

all top 3

all top 3


text:
# Probably a mistake in DFS problem in CS practice

Original problem: https://brilliant.org/practice/depth-first-search/?p=1

I don't actually know if a solution to the problem is correct or not, but I have noticed a flaw in the explanation witch sometime yields wrong results. I outline the problem on paper, so please forgive my terrible handwriting (and my grammar, I am Russian, don't hurt me).

I am not sure if I am correct or not, but if this is of any use I am happy to help! (don't mind a little reward if you're do that, hehe)

My notes:

1:

2:

3:

P.S. I forgot to mention on paper: the problem is a little bit modified -- we only looking for number of vertices that are two hops from vertex 1.

Note by Андрей Антонов
2 weeks, 4 days ago

This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.

When posting on Brilliant:

• Use the emojis to react to an explanation, whether you're congratulating a job well done , or just really confused .
• Ask specific questions about the challenge or the steps in somebody's explanation. Well-posed questions can add a lot to the discussion, but posting "I don't understand!" doesn't help anyone.
• Try to contribute something new to the discussion, whether it is an extension, generalization or other idea related to the challenge.

MarkdownAppears as
*italics* or _italics_ italics
**bold** or __bold__ bold
- bulleted- list
• bulleted
• list
1. numbered2. list
1. numbered
2. list
Note: you must add a full line of space before and after lists for them to show up correctly
paragraph 1paragraph 2

paragraph 1

paragraph 2

[example link](https://brilliant.org)example link
> This is a quote
This is a quote
    # I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
# I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
MathAppears as
Remember to wrap math in $$ ... $$ or $ ... $ to ensure proper formatting.
2 \times 3 $2 \times 3$
2^{34} $2^{34}$
a_{i-1} $a_{i-1}$
\frac{2}{3} $\frac{2}{3}$
\sqrt{2} $\sqrt{2}$
\sum_{i=1}^3 $\sum_{i=1}^3$
\sin \theta $\sin \theta$
\boxed{123} $\boxed{123}$

Sort by:

Hi Андрей, thank you for notifying us. We will respond to you shortly.

Staff - 1 week, 2 days ago