Feat: add new Markdown parser (#39800)
and change all the challenges to new `md` format.
This commit is contained in:
committed by
GitHub
parent
a07f84c8ec
commit
0bd52f8bd1
@@ -1,53 +1,37 @@
|
||||
---
|
||||
id: 5900f49a1000cf542c50ffac
|
||||
challengeType: 5
|
||||
title: 'Problem 300: Protein folding'
|
||||
challengeType: 5
|
||||
forumTopicId: 301954
|
||||
---
|
||||
|
||||
## Description
|
||||
<section id='description'>
|
||||
# --description--
|
||||
|
||||
In a very simplified form, we can consider proteins as strings consisting of hydrophobic (H) and polar (P) elements, e.g. HHPPHHHPHHPH.
|
||||
|
||||
For this problem, the orientation of a protein is important; e.g. HPP is considered distinct from PPH. Thus, there are 2n distinct proteins consisting of n elements.
|
||||
|
||||
When one encounters these strings in nature, they are always folded in such a way that the number of H-H contact points is as large as possible, since this is energetically advantageous.
|
||||
As a result, the H-elements tend to accumulate in the inner part, with the P-elements on the outside.
|
||||
Natural proteins are folded in three dimensions of course, but we will only consider protein folding in two dimensions.
|
||||
When one encounters these strings in nature, they are always folded in such a way that the number of H-H contact points is as large as possible, since this is energetically advantageous. As a result, the H-elements tend to accumulate in the inner part, with the P-elements on the outside. Natural proteins are folded in three dimensions of course, but we will only consider protein folding in two dimensions.
|
||||
|
||||
The figure below shows two possible ways that our example protein could be folded (H-H contact points are shown with red dots).
|
||||
|
||||
The folding on the left has only six H-H contact points, thus it would never occur naturally. On the other hand, the folding on the right has nine H-H contact points, which is optimal for this string.
|
||||
|
||||
Assuming that H and P elements are equally likely to occur in any position along the string, the average number of H-H contact points in an optimal folding of a random protein string of length 8 turns out to be 850 / 28=3.3203125.
|
||||
|
||||
The folding on the left has only six H-H contact points, thus it would never occur naturally.
|
||||
On the other hand, the folding on the right has nine H-H contact points, which is optimal for this string.
|
||||
What is the average number of H-H contact points in an optimal folding of a random protein string of length 15? Give your answer using as many decimal places as necessary for an exact result.
|
||||
|
||||
Assuming that H and P elements are equally likely to occur in any position along the string, the average number of H-H contact points in an optimal folding of a random protein string of length 8 turns out to be 850 / 28=3.3203125.
|
||||
# --hints--
|
||||
|
||||
What is the average number of H-H contact points in an optimal folding of a random protein string of length 15?
|
||||
Give your answer using as many decimal places as necessary for an exact result.
|
||||
</section>
|
||||
|
||||
## Instructions
|
||||
<section id='instructions'>
|
||||
|
||||
</section>
|
||||
|
||||
## Tests
|
||||
<section id='tests'>
|
||||
|
||||
```yml
|
||||
tests:
|
||||
- text: <code>euler300()</code> should return 8.0540771484375.
|
||||
testString: assert.strictEqual(euler300(), 8.0540771484375);
|
||||
`euler300()` should return 8.0540771484375.
|
||||
|
||||
```js
|
||||
assert.strictEqual(euler300(), 8.0540771484375);
|
||||
```
|
||||
|
||||
</section>
|
||||
# --seed--
|
||||
|
||||
## Challenge Seed
|
||||
<section id='challengeSeed'>
|
||||
|
||||
<div id='js-seed'>
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
function euler300() {
|
||||
@@ -58,17 +42,8 @@ function euler300() {
|
||||
euler300();
|
||||
```
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</section>
|
||||
|
||||
## Solution
|
||||
<section id='solution'>
|
||||
# --solutions--
|
||||
|
||||
```js
|
||||
// solution required
|
||||
```
|
||||
|
||||
</section>
|
||||
|
Reference in New Issue
Block a user