[0,1]
[00,01,10,11]
data is usually stored in multiples of
0101 01011
one Byte can store
0 0
00 1
11 0
21 1
3Now, You know
0, 1
You will be able to
Computation | Decimal | ||||
---|---|---|---|---|---|
0
and 1
.Computation | Decimal | ||||
---|---|---|---|---|---|
Berechnung | Dezimalzahl | ||||
---|---|---|---|---|---|
0 | 0 | 0 | 0 | ||
0 | 0 | 0 | 1 | ||
0 | 0 | 1 | 0 | ||
0 | 0 | 1 | 1 | ||
0 | 1 | 0 | 0 | ||
0 | 1 | 0 | 1 |
The table contains examples of how natural numbers can be represented in the binary system:
The lamps of the half adder also represent a binary number.
1
or 0
.1
or 0
00
, 01
, 10
, 11
Button A | Button B | Lamp left | Lamp right | Decimal |
---|---|---|---|---|
0 | 0 | 0 | 0 | 0 |
1 | 0 | 0 | 1 | 1 |
0 | 1 | 0 | 1 | 1 |
1 | 1 | 1 | 0 | 2 |
Button A | Button B | Lamp left: |
Lampe right: |
Zahlenwert |
---|---|---|---|---|
0 | 0 | 0 | 0 | |
1 | 0 | 0 | 1 | |
0 | 1 | 0 | 1 | |
1 | 1 | 1 | 0 |
A sign bit (SB) can be reserved to also represent negative numbers
SB | Computation | Decimal | |||
---|---|---|---|---|---|
1 | 1 | 0 | 0 |
int
)uint
)integer
value as a decimal number that a computer can store in each of the following numbers of bits?Number of bits | with sign bit | smallest integer |
largest integer |
---|---|---|---|
3 | yes | ||
3 | no | ||
4 | yes | ||
4 | no |
5 minutes
integer
value as a decimal number that a computer can store in each of the following memory array?Number of bits | with sign bit | smallest integer |
largest integer |
---|---|---|---|
yes | |||
no | |||
yes | |||
no |
Binary | Decimal | |
---|---|---|
1001 |
||
+ | 0011 |
|
= | _ _ _ _ |
Binary | Decimal | |
---|---|---|
1001 |
||
+ | 0011 |
|
= | ___0 |
10
0
write to last digit (sum bit s
)1
transfer to penultimate digit (carrier bit c
)Binary | Decimal | |
---|---|---|
1001 |
||
+ | 0011 |
|
+ | __1_ |
|
= | __00 |
1
)0+1+1 = 10
0
in penultimate place1
transfer to penultimate digitBinary | Decimal | |
---|---|---|
1001 |
||
+ | 0011 |
|
+ | _1__ |
|
= | _100 |
0+1+0 = 1
1
1
to the second to last digitBinary | Decimal | |
---|---|---|
1001 |
||
+ | 0011 |
|
= | 1100 |
1+0 = 1
1
1
to the second to last digitYou will be able to
a) binary image
a) greyscale image
0
to 255
((11111111 0000000 11111111) (0000000 0000000 00000000) (11111111 11111111 00000000)
(11111111 0000000 11111111) (0000000 0000000 00000000) (11111111 11111111 00000000)
(11111111 0000000 11111111) (0000000 0000000 00000000) (11111111 11111111 00000000)
You will be able to
Data: 100010
Code
00
: A
, 01
: T
, 10
: G
, 11
: C
Information
GAG
Codon for Glutamate1.1 + 2.2
#> 3.3000000000000003
3 minutes
float
, single
, double
, real
You will be able to
00
: G01
: C10
: A11
: T*
)*
can be used as a parity bit01000010 01001100 01010100
The Text-Editor translates the Binary Code in Characters
01000011 01000011 01010100 01010100 01010100 01000011 <...>
CCTTTC <...>
You will be able to
Epimenides the Cretan said: All Cretans are liars.
If the lamp is not on, it must be off.
x=True
, x=1
y=False
, y=0
Is Adam not there?
truth table
=1
if (warning_level > 2 and slope>35):
high_avalanche_risk = True
1>2
➜ False
"a" =="a"
➜ True
"a" !="a"
➜ False
Basic for operations in computers e.g. addition of numbers.
Helpful for search queries in Google and databases.
Three operations:
and
)or
)not
)("homo sapiens"[Organism] OR "mus musculus"[Organism]) AND OCA1[Gene Name])
("homo sapiens"[Organism] OR ("mus musculus"[Organism] AND OCA1[Gene Name]))
Organism | Gene | FASTA File | Organism =="homo sapiens" |
Organism =="mus musculus" |
Gene =="OCA1" |
|
---|---|---|---|---|---|---|
homo sapiens | TP53 | ... | True |
False |
False |
False |
homo sapiens | OCA1 | ... | True |
False |
True |
True |
mus musculus | OCA1 | ... | False |
True |
True |
True |
mus musculus | TP53 | ... | False |
True |
False |
False |
mus musculus | GDF8 | ... | False |
True |
False |
False |
bos taurus | GDF8 | ... | False |
False |
False |
False |
(GDF8[Gene Name]) AND ("Homo sapiens"[Organism] or "Bos Taurus"[Organism])
age_years | weight_kg | |||
---|---|---|---|---|
20 | 60 | |||
34 | 70 | |||
25 | 120 | |||
26 | 90 |
age | weight | |||
---|---|---|---|---|
20 | 60 | FALSE |
TRUE |
FALSE |
34 | 70 | FALSE |
FALSE |
FALSE |
25 | 120 | TRUE |
TRUE |
FALSE |
26 | 90 | TRUE |
TRUE |
FALSE |
You will be able to
Booleans: a = True
: stored as 1
Integers: 101
Floats:
Strings: 01000001 01000010
The computer stores it in binary code
a
) has a certain data type (e.g., Boolean, Integer, etc.)"a" == "a"
? 0100 0001 == 0100 0001
0100 0001
0100 0001
_________
0000 0000 == 0
You will be able to
"Shotgun sequencing is a laboratory technique for determining the DNA sequence of an organism’s genome. The method involves randomly breaking up the genome into small DNA fragments that are sequenced individually. A computer program looks for overlaps in the DNA sequences, using them to reassemble the fragments in their correct order to reconstitute the genome." genome.gov
You have a list of fragmented DNA-snippets that have to be ordered in the right order. Your task is to implement an algorithm, that brings the DNA-sequence into thr right order.
"TAGCTAGCTAGCTTTTAGTTAGCAGCC"
Building blocks for algorithms
=if x == True:
)and
, =
)Algorithms
An algorithm is called terminating if it terminates (stops) (for any allowed input of parameter values) after finitely many steps.
establishes "freedom of choice" or "randomness" in execution
Deterministic algorithm:
Non-determined "algorithm"
+
, and
, =
, etc.)if
)while
, for
)Result = 2
True and False
(operation)True == True
(comparison)5+2
(1) Boil water
(2) Put coffee powder into cup
(3) Fill water into cup
(2) Pour coffee powder into cup
refined to
(2.1) Open coffee glass
(2.2) Take out spoon of coffee
(2.3) Tilt spoon into cup
(2.4) Close coffee glass
if <condition>
then <step>
resp.
if <condition>
then <step a>
otherwise <step b>
if coffee is available
then open coffee glass
otherwise go to favorite cafe
if favorite cafe open
then order coffee
otherwise
go on to MCI
/* next prime */
repeat
Add 1;
test for prime number property
until number is prime;
output number
assemble_sequence()
1) draw a random seed sequence
2) while sequences left
2.1) draw next sequence
2.2) compare_beginning(overlap)
if match glue_fragments_end()
2.3) compare_end(overlap)
if match glue_fragments_end()
Graphical description of the flow of an algorithm
assemble_sequence()
1) draw a random seed sequence
2) while sequences left
2.1) draw next sequence
2.2) compare_beginning(overlap)
if match glue_fragments_end()
2.3) compare_end(overlap)
if match glue_fragments_end()
Create and UML activity diagram that creates the complement of a DNA sequence
e.g., TCCACTGTGGCGTTCGGAATATAATCG
verbal description
T
➜A
A
➜T
C
➜G
G
➜C
TCCACTGTGGCGTTCGGAATATAATCG
AGG...
graph TD
start[Start] --> create_list(Create empty temporary list)
create_list --> start_loop(what is the first/next letter in the original list)
start_loop -->|Next letter == A| A(Add a T to the temporary list)
start_loop -->|Next letter == T| T(Add a A to the temporary list)
start_loop -->|Next letter == G| G(Add a C to the temporary list)
start_loop -->|Next letter == C| C(Add a G to the temporary list)
A --> letters_left(are there any letters left in the original list)
T --> letters_left
G --> letters_left
C --> letters_left
letters_left -->|yes| start_loop
letters_left -->|no| stop_loop(return the temporary list as complement)
stop_loop --> Stop
ATG
), through a subsequent region which usually has a length that is a multiple of 3 nucleotides to a stop codon (e.g., TGA
) in the same reading frame.found_open_reading_frame
: True
or False
start_position
: number of the first letter of the reading frame (A
in the ATG
)stop_position
: number of the last letter of the reading frame (A
in the TGA
)found_open_reading_frame
to False
ATG
A
in start_position
TGA
A
in stop_position
found_open_reading_frame
to True
graph TD
start[Start] --> setFound(Found open_reading_frame = False)
setFound --> loopStart{Iterate through RNA sequence}
loopStart -->|Next three letters == ATG| noteStart(Note position of A in start_position)
loopStart -->|Next three letters != ATG| moveNext
loopStart -->|No letters left| stop
moveNext[go to next letter] --> loopStart
noteStart --> loopPairs{Iterate through next three-letter pairs}
loopPairs -->|pair == TGA| noteStop(Note position of A in stop_position)
loopPairs -->|pair is not TGA| continuePairs[go to next pair]
continuePairs --> loopPairs
loopPairs -->|no pair left| loopStart
noteStop --> setTrue(Set found_open_reading_frame to True)
setTrue --> stop