Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
algorand
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nilak
algorand
Commits
9b7da117
Commit
9b7da117
authored
Apr 16, 2019
by
UNHALE NILESH ARUN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nilesh had questions
parent
229dbcb5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
24 deletions
+18
-24
README.md
README.md
+0
-6
Utility.py
Utility.py
+18
-18
No files found.
README.md
View file @
9b7da117
...
...
@@ -12,7 +12,6 @@
`pip3 install -r requirements.txt `
*
Setup
...
...
@@ -24,8 +23,3 @@
### Nilesh doubts:
1 Why start ticking function has a callback arg.?
\
2 What does callback do?
3 What simulate do ?
4 What compute range ?
5 node and links
\ No newline at end of file
Utility.py
View file @
9b7da117
...
...
@@ -51,7 +51,7 @@ def verifyVRF(pk,hash,proof,seed):
def
sortition
(
sk
,
seed
,
rolecount
,
role
,
w
,
badaW
,
pk
):
'''
:param sk: secret
e
key
:param sk: secret key
:param seed:
:param rolecount: tou
:param role:
...
...
@@ -135,23 +135,23 @@ def verifySort(pk,hash,proof,seed,rolecount,role,w,badaW):
return
j
def
computeRange
():
badaW
=
10
lastValue
=
0
;
p
=
0.5
x
=
0.0023
j
=
0
if
(
x
<=
stats
.
binom
.
pmf
(
0
,
badaW
,
p
)):
j
=
0
else
:
for
k
in
range
(
0
,
badaW
+
1
):
lastValue
=
lastValue
+
stats
.
binom
.
pmf
(
k
,
badaW
,
p
)
nextvalue
=
lastValue
+
stats
.
binom
.
pmf
(
k
+
1
,
badaW
,
p
)
print
(
lastValue
)
print
(
nextvalue
)
print
(
"------------"
)
j
=
j
+
1
#
def computeRange():
#
badaW=10
#
lastValue = 0;
#
p = 0.5
#
x = 0.0023
#
j = 0
#
if (x<=stats.binom.pmf(0, badaW, p)):
#
j = 0
#
else :
#
for k in range(0,badaW+1):
#
lastValue = lastValue + stats.binom.pmf(k, badaW, p)
#
nextvalue =lastValue+ stats.binom.pmf(k+1, badaW, p)
#
print(lastValue)
#
print(nextvalue)
#
print("------------")
#
j =j+1
#
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment