Skip to content

Commit f3f3228

Browse files
author
Daniel Dahan
committed
updated README
1 parent 11f4c1f commit f3f3228

File tree

3 files changed

+25
-15
lines changed

3 files changed

+25
-15
lines changed

Algorithm.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22
s.name = 'Algorithm'
3-
s.version = '1.0.7'
4-
s.license = 'BSD'
3+
s.version = '1.0.8'
4+
s.license = 'BSD-3-Clause'
55
s.summary = 'A toolset for writing algorithms in Swift.'
66
s.homepage = 'http://cosmicmind.io'
77
s.social_media_url = 'https://www.facebook.com/graphkit'

README.md

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
![CosmicMind](http://www.cosmicmind.io/CM/CosmicMind.png)
1+
![CosmicMind](http://www.cosmicmind.io/algorithm/index/images/AlgorithmIcon.png)
22

33
## Welcome to Algorithm
44

5-
Explore a world of data structures in Swift. Learn how to use data structures to organize, analyze, and manipulate data.
5+
Algorithm is a collection of data structures that are empowered by a probability toolset.
6+
7+
Algorithm's architecture is designed for beginners and professionals. Its robust API requires no setup and is ready for the simplest and most extensive applications.
68

79
## Requirements
810

911
* iOS 8.0+ / Mac OS X 10.9+
10-
* Xcode 7.2+
12+
* Xcode 7.3+
1113

1214
## Communication
1315

@@ -31,6 +33,7 @@ Algorithm is a growing project and will encounter changes throughout its develop
3133
## A Tour
3234

3335
* [Probability](#probability)
36+
* [ExpectedValue](#expectedvalue)
3437
* [DoublyLinkedList](#doublylinkedlist)
3538
* [Stack](#stack)
3639
* [Queue](#queue)
@@ -44,23 +47,20 @@ Algorithm is a growing project and will encounter changes throughout its develop
4447
<a name="probability"></a>
4548
## Probability
4649

47-
Probability is a core feature. Your application may be completely catered to your users' habits and usage. To demonstrate this wonderful feature, let's look at some examples:
50+
Each data structure within Algorithm is equipped with probability tools.
51+
52+
#### Basic Probability
4853

49-
Determining the probability of rolling a 3 using a die of 6 numbers.
54+
For example, determining the probability of rolling a 3 using a die of 6 numbers.
5055

5156
```swift
5257
let die: Array<Int> = Array<Int>(arrayLiteral: 1, 2, 3, 4, 5, 6)
5358
print(die.probabilityOf(3)) // Output: 0.166666666666667
5459
```
5560

56-
The expected value of rolling a 3 or 6 with 100 trials using a die of 6 numbers.
57-
58-
```swift
59-
let die: Array<Int> = Array<Int>(arrayLiteral: 1, 2, 3, 4, 5, 6)
60-
print(die.expectedValueOf(100, elements: 3, 6)) // Output: 33.3333333333333
61-
```
61+
#### Conditional Probability
6262

63-
The above examples are quite simple. They use basic calculations to determine the probability of an outcome (X). What if you have a complicated condition? To solve this problem, it is possible to pass in blocks that return a boolean value. Each block may execute any operations it pleases, so long as it returns a "true" or "false". The "true" values contribute to the likelihood of an outcome, "false" results do not. Below is an example to demonstrate this feature.
63+
For conditional probabilities that require a more complex calculation, use block statements.
6464

6565
```swift
6666
let die: Array<Int> = Array<Int>(arrayLiteral: 1, 2, 3, 4, 5, 6)
@@ -78,6 +78,16 @@ if 0.33 < probabilityOfX {
7878
}
7979
```
8080

81+
<a name="expectedvalue"></a>
82+
## Expected Value
83+
84+
The expected value of rolling a 3 or 6 with 100 trials using a die of 6 numbers.
85+
86+
```swift
87+
let die: Array<Int> = Array<Int>(arrayLiteral: 1, 2, 3, 4, 5, 6)
88+
print(die.expectedValueOf(100, elements: 3, 6)) // Output: 33.3333333333333
89+
```
90+
8191
<a name="doublylinkedlist"></a>
8292
## DoublyLinkedList
8393

Sources/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.0.7</string>
18+
<string>1.0.8</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

0 commit comments

Comments
 (0)