推理編程_答案集編程的知識表示和推理

推理編程

Read about the difference between declarative and imperative programming and learn from code examples (Answer Set Programming, Python and C).

了解聲明式和命令式編程之間的區別,并從代碼示例(答案集編程,Python和C)中學習。

介紹 (Introduction)

The amount of computational problems seems to be unlimited in both industry and science. There is a huge demand for new insights from the vast amount of available data. To obtain this knowledge, dedicated people use all kinds of programming languages for designing and implementing algorithms.

在工業和科學領域,計算問題的數量似乎都是無限的。 從大量可用數據中獲得對新見解的巨大需求。 為了獲得這些知識,敬業的人們使用各種編程語言來設計和實現算法。

However, many of the current real-world problems are complex (combinatorial) search problems with which we try to automate and optimize processes as well as support people in their decisions. This does not involve encoding of algorithms but encoding given knowledge. In other words, given knowledge about all the rules and constraints to be considered to what is counted as a solution. Instead of writing statements describing the control flow of a computation, declarative programming expresses its logic. What do we want to achieve, not statements about how we can achieve it.

但是,當前許多現實世界中的問題都是復雜的(組合)搜索問題,我們試圖通過這些問題來自動化和優化流程,并支持人們的決策。 這不涉及算法的編碼,而是編碼給定的知識 。 換句話說,已知關于所有規則和約束的知識,可以考慮將其視為解決方案。 聲明性編程不是編寫描述計算控制流程的語句,而是表達其邏輯。 我們想要實現什么 ,而不是關于如何實現的聲明。

This is called declarative programming.

這稱為聲明式編程。

為什么要進行聲明式編程? (Why declarative programming?)

Using a promising declarative programming paradigm, namely Answer Set Programming (ASP, sometimes also Answer Set Prolog), offers unexpected advantages over the popular imperative programming approach, for example:

使用有希望的聲明式編程范例,即答案集編程(ASP,有時也稱為答案集Prolog),與流行的命令式編程方法相比,具有出乎意料的優勢,例如:

  • Short solutions (as measured by lines of code)

    簡短的解決方案(按代碼行衡量)
  • Transparency (including readability)

    透明度(包括可讀性)
  • Reliability

    可靠性

and many more. Once you have broken the problem down into its smallest pieces and written down all the necessary knowledge, you will not only solve the computational challenge. A big advantage is that you have digitized the knowledge and can use it for further problems or make it available in other ways.

還有很多。 將問題分解為最小的部分并寫下所有必要的知識后,您不僅會解決計算難題。 一個很大的好處是您已經數字化了知識,可以將其用于其他問題或以其他方式使用。

E

?

Furthermore, it strengthens the cooperation between ‘business people’ and programmers. The integration of artificial intelligence is supported and acceptance at all levels will increase. This is a fundamental process that can only be achieved in cooperation with all departments of a company.

此外,它加強了“商人”與程序員之間的合作。 支持人工智能的集成,并且在各個級別的接受度都會增加。 這是一個基本過程,只有與公司所有部門合作才能實現。

什么是ASP?如何運作? (What is ASP and how does it work?)

An answer set program consists of given knowledge formulated as facts, rules (head(X) :- body(X).) or constraints. The program is loaded by a solver and returns a “stable model”. This so called answer set consists of all facts that can be derived using the given rules and constraints. A finite amount of stable models are generated as solutions, of which one is finally selected.Note: grounding and solving the problems are not within the scope of this article.

答案集程序包括由事實,規則( head(X) :- body(X). )或約束條件組成的給定知識。 該程序由求解器加載并返回“穩定模型”。 所謂的答案集包括可以使用給定的規則和約束導出的所有事實。 生成有限數量的穩定模型作為解決方案,最后選擇其中一個。 注意: 接地和解決問題不在本文討論范圍之內。

Let us consider a famous example from logic about birds and penguins. It is a well known fact that birds can fly. This can be encoded as an answert set rule:

讓我們考慮一個關于鳥類和企鵝的邏輯的著名例子。 眾所周知,鳥類會飛。 可以將其編碼為應答集規則:

canFly(X) :- bird(X).

The rule is read as “If X is a bird, then X can fly”. Now let’s add more knowledge! For example, facts that tell the unconditional truth, just as seagull ‘Malvin’ is a bird, but also penguin ‘Roger’ is one.

規則讀為“如果 X 是鳥,那么 X 會飛” 。 現在,讓我們添加更多知識! 例如,事實證明了無條件的事實,就像海鷗“ Malvin”是一只鳥,而企鵝“ Roger”是一只鳥一樣。

canFly(X) :- bird(X).
bird(malvin).
bird(roger).== MODEL OUTPUT ==
Anwer: 1
bird(malvin) bird(roger) canFly(malvin) canFly(roger)
SATISFIABLE

As a result, the answer set tells us the known facts that Malvin and Roger are birds but also concluded that they are able to fly. The biology enthusiasts among us know, that penguins are unable to fly thus the model is wrong!

結果,答案集告訴我們已知的事實,即馬爾文和羅杰是鳥類,但也得出結論,他們能夠飛翔。 我們當中的生物學愛好者知道,企鵝無法飛行,因此模型是錯誤的!

Image for post
Seagull ‘Malvin’ — slightly showing off because he can fly. (Photo by Phil Botha on Unsplash)
海鷗“ Malvin”-因為他會飛而稍微炫耀。 ( Phil Botha在Unsplash上拍攝 )

In order to get acceptable results we need to add more knowledge in form of facts and integrity constraints to the program. Here, the model needs to know that Roger is not only a bird but also a penguin and that there is no bird that is a penguin which is able to fly.

為了獲得可接受的結果,我們需要以事實和完整性約束的形式向程序添加更多知識。 在這里,模型需要知道羅杰不僅是鳥,而且還是企鵝,并且沒有鳥是能夠飛翔的企鵝。

canFly(X) :- bird(X).
bird(malvin).
bird(roger).
seagull(malvin).
penguin(roger).
:- canFly(X), penguin(X).== MODEL OUTPUT ==
UNSATISFIABLE

This does not bring the expected result and shows how important it is to think thoroughly and very carefully about the problem as well as the solution. The model tells, like stated by the programmer, that a bird can fly but there is no advise for birds that belong to the penguin family. To avoid this, we could add that only birds that are not penguins are able to fly.

這并沒有帶來預期的結果,并且表明了對問題以及解決方案進行透徹和仔細思考的重要性。 如程序員所述,該模型告訴鳥類可以飛,但是沒有建議屬于企鵝家族的鳥類。 為了避免這種情況,我們可以補充說,只有不是企鵝的鳥才可以飛。

canFly(X) :- bird(X), not penguin(X).
bird(malvin).
bird(roger).
seagull(malvin).
penguin(roger).
:- canFly(X), penguin(X).== MODEL OUTPUT ==
Answer: 1
bird(malvin) bird(roger) seagull(malvin) penguin(roger) canFly(malvin)
SATISFIABLE

Adding this knwoledge in Line [1], the stable model consists of the expected outcome.

在行[1]中添加此知識,穩定模型包括預期結果。

命令式與聲明式編程 (Imperative versus declarative programming)

..解決數獨 (.. for solving Sudoku)

Let’s look at another example to highlight the advantages of ASP mentioned above. Sudoku is a well known puzzle game and popular for explaining search problems. Given an initial 9x9 grid of cells containig numbers between 1 and 9 or blanks, all blanks must be filled with numbers. You win Sudoko if you find all values such that every row, column, and 3x3 subsquare contains the numbers 1–9, each with a single occurrence.

讓我們看另一個示例,以突出上述ASP的優點。 數獨是著名的益智游戲,因解釋搜索問題而廣受歡迎。 給定一個最初的9x9單元格網格,其中包含1到9之間的數字或空格,所有空格必須用數字填充。 如果您找到所有值,使每一行,每一列和3x3子正方形包含數字1–9,并且每個數字都出現一次,那么您將贏得Sudoko。

Image for post
Exemplary Sudoku game (adopted from Potassco.org).
示例數獨游戲(從Potassco.org采納)。

Python(命令式) (Python (imperative))

The following Code snippet will show how to solve the Sudoku in Python.

以下代碼片段將顯示如何在Python中解決Sudoku。

Solve Sudoku in Python.
用Python解決數獨問題。

C(必須) (C (imperative))

Solving the Sudoku game in C looks very similar to Python. There is no significant difference in the approach.

用C解決Sudoku游戲看起來與Python非常相似。 該方法沒有顯著差異。

Solve Sudoku in C.
解決C中的數獨問題。

Both, Python and C, show written statements describing the control flow of a computation, thus, the ‘how to solve it’ and how the state has to be changed for the upcoming step.

Python和C都顯示了描述計算控制流的書面語句,從而描述了“ 如何求解”以及在接下來的步驟中必須如何更改狀態。

ASP(說明性) (ASP (declarative))

Last but no least, let’s have a look at the ASP code snippet — after initalization, we are able to solve the Sudoku with less than 10 lines of code!

最后但并非最不重要的一點,讓我們看一下ASP代碼段–初始化后,我們可以用少于10行的代碼來解決Sudoku!

% Initialize the game (given numbers)
sudoku(1, 1, 5).
sudoku(1, 2, 3).
sudoku(1, 5, 7).
sudoku(2, 1, 6).
sudoku(2, 4, 1).
sudoku(2, 5, 9).
sudoku(2, 6, 5).
sudoku(3, 2, 9).
sudoku(3, 3, 8).
sudoku(3, 8, 6).
sudoku(4, 1, 8).
sudoku(4, 5, 6).
sudoku(4, 9, 3).
sudoku(5, 1, 4).
sudoku(5, 4, 8).
sudoku(5, 6, 3).
sudoku(5, 9, 1).
sudoku(6, 1, 7).
sudoku(6, 5, 2).
sudoku(6, 9, 6).
sudoku(7, 2, 6).
sudoku(7, 7, 2).
sudoku(7, 8, 8).
sudoku(8, 4, 4).
sudoku(8, 5, 1).
sudoku(8, 6, 9).
sudoku(8, 9, 5).
sudoku(9, 5, 8).
sudoku(9, 8, 7).
sudoku(9, 9, 9).
% define the grid
n(1..9).
x(1..9).
y(1..9).% each field contains exactly one number from 1 to 9
{sudoku(X,Y,N): n(N)} = 1 :- x(X) ,y(Y).% helper
subgrid(X,Y,A,B) :- x(X), x(A), y(Y), y(B),(X-1)/3 == (A-1)/3, (Y-1)/3 == (B-1)/3.% constraints
:- sudoku(X,Y,N), sudoku(A,Y,N), X!=A.
:- sudoku(X,Y,N), sudoku(X,B,N), Y!=B.
:- sudoku(X,Y,V), sudoku(A,B,V), subgrid(X,Y,A,B), X != A, Y != B.#show sudoku/3.== MODEL OUTPUT ==
Answer: 1
('sudoku', (2, 1, 6)), ('sudoku', (1, 2, 3)), ('sudoku', (9, 4, 2)), ('sudoku', (7, 2, 6)), ('sudoku', (7, 3, 1)), ('sudoku', (1, 9, 2)), ('sudoku', (5, 1, 4)), ('sudoku', (7, 4, 5)), ('sudoku', (4, 3, 9)), ('sudoku', (9, 1, 3)), ('sudoku', (4, 5, 6)), ('sudoku', (5, 6, 3)), ('sudoku', (2, 4, 1)), ('sudoku', (8, 1, 2)), ('sudoku', (8, 8, 3)), ('sudoku', (7, 9, 4)), ('sudoku', (8, 7, 6)), ('sudoku', (5, 4, 8)), ('sudoku', (7, 6, 7)), ('sudoku', (8, 6, 9)), ('sudoku', (6, 5, 2)), ('sudoku', (9, 7, 1)), ('sudoku', (3, 4, 3)), ('sudoku', (4, 7, 4)), ('sudoku', (3, 3, 8)), ('sudoku', (4, 8, 2)), ('sudoku', (1, 7, 9)), ('sudoku', (9, 9, 9)), ('sudoku', (9, 8, 7)), ('sudoku', (5, 9, 1)), ('sudoku', (4, 4, 7)), ('sudoku', (6, 9, 6)), ('sudoku', (7, 7, 2)), ('sudoku', (2, 7, 3)), ('sudoku', (5, 5, 5)), ('sudoku', (1, 5, 7)), ('sudoku', (1, 1, 5)), ('sudoku', (6, 3, 3)), ('sudoku', (2, 6, 5)), ('sudoku', (2, 9, 8)), ('sudoku', (8, 3, 7)), ('sudoku', (3, 6, 2)), ('sudoku', (3, 8, 6)), ('sudoku', (2, 8, 4)), ('sudoku', (1, 3, 4)), ('sudoku', (8, 2, 8)), ('sudoku', (3, 7, 5)), ('sudoku', (9, 5, 8)), ('sudoku', (4, 9, 3)), ('sudoku', (6, 4, 9)), ('sudoku', (7, 5, 3)), ('sudoku', (2, 5, 9)), ('sudoku', (8, 5, 1)), ('sudoku', (5, 3, 6)), ('sudoku', (4, 6, 1)), ('sudoku', (3, 9, 7)), ('sudoku', (1, 4, 6)), ('sudoku', (9, 2, 4)), ('sudoku', (5, 8, 9)), ('sudoku', (1, 8, 1)), ('sudoku', (6, 6, 4)), ('sudoku', (5, 7, 7)), ('sudoku', (7, 1, 9)), ('sudoku', (3, 5, 4)), ('sudoku', (6, 8, 5)), ('sudoku', (5, 2, 2)), ('sudoku', (2, 3, 2)), ('sudoku', (8, 9, 5)), ('sudoku', (9, 6, 6)), ('sudoku', (9, 3, 5)), ('sudoku', (6, 2, 1)), ('sudoku', (3, 1, 1)), ('sudoku', (4, 2, 5)), ('sudoku', (6, 1, 7)), ('sudoku', (4, 1, 8)), ('sudoku', (8, 4, 4)), ('sudoku', (2, 2, 7)), ('sudoku', (3, 2, 9)), ('sudoku', (1, 6, 8)), ('sudoku', (6, 7, 8)), ('sudoku', (7, 8, 8))}
SATISFIABLE

Note: using for example a Python wrapper for ASP, the result can look as handy as in the code examples above.

注意 :例如,使用ASP的Python包裝器,結果看起來就像上面的代碼示例一樣方便。

Compared to Python and C, this is all about the ‘what’ and not about the ‘how’ — a fundamental difference between the two approaches.

與Python和C相比,這全都涉及“什么”而不是“如何”,這是這兩種方法之間的根本區別。

At the very beginning, we define that the Sudoku board is 9x9 cells (or fields) and we use the numbers from 1 to 9 as the values to fill in. Following the basic rule that only one number between 1 and 9 may be filled in each field, we define a little helper. It states which fields refer to the same sub-grid. Finally, we only need the constraints to tell the solver what is possible and what is not. The first line checks, whether the choosen number is unique in the row whereas the second constraint checks the rule for columns. The third constraint completes the rules of the game, according to which a number must also be unique in the subgrid.

在一開始,我們定義Sudoku板是9x9單元(或字段),并使用1到9之間的數字作為填充值。遵循基本規則,即只能填充1到9之間的一個數字每個領域,我們定義一個小幫手。 它指出哪些字段引用相同的子網格 。 最后,我們只需要約束就可以告訴求解器什么是可能的,什么不是。 第一行檢查選擇的數字在行中是否唯一,而第二行約束檢查列的規則。 第三個約束完善了游戲規則,根據該規則,子網格中的數字也必須唯一。

That was it. I admit the syntax takes getting used to. But once you’re familiar with it, you can create incredibly readable programs that solve highly complex problems for us.

就是這樣 我承認語法需要習慣。 但是一旦您熟悉了它,就可以創建可讀性極強的程序,為我們解決高度復雜的問題。

摘要 (Summary)

ASP is a very promising tool for knowledge preservation and declarative problem solving in the area of Knowledge Representation and Reasoning.

ASP是用于知識表示和推理領域的知識保存和聲明式問題解決的非常有前途的工具。

Short solutions — Apart from the initial effort to map the Sudoku game, ASP provides by far the shortest way (measured in lines of code) to the solution.Transparency — There is no need to create rules which are unclear to the user and which concern the status of the programme. Only the basic conditions and the three rules of the game must be coded in order to end up at the correct result.Reliability — All rules of the game are fixed and the solver cannot create a black box with solution steps that are not traceable afterwards. This may not be important in the example given, but it is a major issue in many industrial applications.

簡短的解決方案 -除了最初嘗試繪制Sudoku游戲的映射外,ASP還提供了迄今為止解決方案的最短方法(以代碼行衡量)。 透明度 -無需創建用戶不清楚且與程序狀態有關的規則。 為了最終得到正確的結果,只有游戲的基本條件和三個規則必須被編碼。 可靠性 -游戲的所有規則都是固定的,求解器無法創建一個黑匣子,其解決方案步驟不可追溯。 在給出的示例中,這可能并不重要,但在許多工業應用中這是一個主要問題。

To mention only a few real-world examples, decision support for space shuttles at NASA, train scheduling in Switzerland — one of the world’s densest train network— , or team building at the largest transshipment terminal on the Mediterranean coast are evidence of its potential.

僅舉幾個實際的例子,對美國宇航局航天飛機的決策支持,瑞士的火車時刻表(世界上最密集的火車網絡之一)或在地中海沿岸最大的轉運碼頭的團隊建設都證明了其潛力。

底線 (Bottom Line)

The acceptance of artificial intelligence in industry is still very low. In addition, many companies are simply overwhelmed by the existing flood of data.

人工智能在工業中的接受程度仍然很低。 此外,許多公司對現有的大量數據不知所措。

Bring the knowledge of operational subject matter experts together with the strengths of Artificial Intelligence.

將操作主題專家的知識與人工智能的優勢結合在一起。

ASP offers an unique opportunity to digitalize and protect existing knowledge. Due to the good readability and the required understanding of the process as well as the problem to be solved, IT and business move closer together and thus achieve better and more sustainable success.

ASP為數字化和保護現有知識提供了獨特的機會。 由于良好的可讀性和對流程以及所要解決問題的理解要求,IT和業務部門之間的距離越來越近,從而獲得了更好,更可持續的成功。

你喜歡這個故事嗎? (Did you like the story?)

I appreciate likes and retweets of this article – there will be more about this topic soon! You can also find an executive summary here.

我喜歡本文的喜歡和轉發-很快將有更多關于此主題的信息! 您也可以在此處找到執行摘要。

翻譯自: https://towardsdatascience.com/knowledge-representation-and-reasoning-with-answer-set-programming-376e3113a421

推理編程

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/387863.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/387863.shtml
英文地址,請注明出處:http://en.pswp.cn/news/387863.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

給Hadoop初學者的一些建議

我們介紹了新手學習hadoop的入門注意事項。這篇來談談hadoop核心知識學習。 hadoop核心知識學習: hadoop分為hadoop1.X和hadoop2.X,并且還有hadoop生態系統。這里只能慢慢介紹了。一口也吃不成胖子。 那么下面我們以hadoop2.x為例進行詳細介紹: Hadoop…

Guide AHOI2017 洛谷P3720

Description 農場主John最近在網上買了一輛新車,在購買汽車配件時,John不小心點了兩次“提交”按鈕。導致汽車上安裝了兩套GPS系統,更糟糕的是John在使用GPS導航時,兩套系統常常給出不同的路線。從地圖上看,John居住的…

穩坐視頻云行業第一,阿里云將用邊緣計算開辟新賽道

“CDN競爭的上半場已結束,中國視頻云市場格局已定,邊緣計算將成為下半場發展的新賽道。” 4月10日,阿里云視頻云總經理、邊緣計算負責人朱照遠在第七屆“亞太內容分發大會”暨CDN峰會表示。朱照遠認為,阿里云依靠齊全的產品矩陣、…

愛因斯坦提出的邏輯性問題_提出正確問題的重要性

愛因斯坦提出的邏輯性問題We live in a world that values answers. We were taught in school to learn how to answer questions in exams, we were conditioned to go to work knowing that we need to have the answers and our society, by and large, focuses on finding…

python安裝包

由于Google、YouTube等大型公司的推廣,Python編程語言越來越受歡迎,很多編程愛好者,也將Python做為了首先的編程語言。 今天我們就來講一下,學習的第一步,安裝Python IDLE編輯器,也它的調試和使用。 第一步…

104 權限 sudo 解壓縮

主要內容:https://www.cnblogs.com/pyyu/articles/9355477.html 1 查看系統版本信息: #查看系統版本信息 cat /etc/redhat-release CentOS Linux release 7.4.1708 (Core) #查看內核版本號 uname -r 3.10.0-693.el7.x86_64 #查看系統多少位 uname -m x86_64 #查看內核所有信息…

Cloud Native 介紹

為什么80%的碼農都做不了架構師?>>> 背景 Cloud Native表面看起來比較容易理解,但是細思好像又有些模糊不清:Cloud Native和Cloud關系是啥?它用來解決什么問題?它是一個新技術還是一個新的方法&#xff1f…

餐廳數據分析報告_如何使用數據科學選擇理想的餐廳設計場所

餐廳數據分析報告空間數據科學 (Spatial Data Science) Designing any product requires a lot of analysis and research. It is also true for designing any building. Before we begin to design any building, we collect information about the location where we are de…

P2P原理及UDP穿透簡單說明

本文章出自cnntec.com的AZ貓著,如需要轉發,請注明來自cnntec.com Peer-To-Peer縮寫P2P 中文稱之為對等聯網。 用途于交流,比如QQ,MSN等等。 文件傳輸、分布式數據計算等等。 這里我們主要是是簡單講解一下UDP實現NAT的穿透&…

PCB genesis 大孔擴孔(不用G84命令)實現方法

PCB鉆孔時,當鉆刀>6.3mm時,超出鉆孔范圍,鉆孔工序是沒有這么大的鉆刀,當這種情況,工程CAM會都采用G84命令用小孔擴孔的方式制作, 在這里介紹一種如果不用G84命令,用程序實現將大孔生成小孔鉆孔達到擴孔的目的。 一.我們先了解一下G84命令擴孔 孔尺寸大小 孔密度 連一篇文章有…

一年沒做出量化策略_量化信念:如何做出更好的決定

一年沒做出量化策略By Stuart George, Executive Director of Design Technology at MethodMethod設計技術執行總監Stuart George When Andrew Mason, founder of Groupon, wanted to improve his email conversion metrics, he turned to data analysis. His team tested the…

Android Jetpack組件之數據庫Room詳解(二)

本文涉及Library的版本如下: androidx.room:room-runtime:2.1.0-alpha03androidx.room:room-compiler:2.1.0-alpha03(注解編譯器)回顧一下安卓的SQLiteOpenHelper相關類 首先放一個關于安卓數據庫的類圖: SQLiteOpenHelper是一個抽象類,通常自己實現數據…

圖像識別中的深度學習

來源:《中國計算機學會通訊》第8期《專題》 作者:王曉剛 深度學習發展歷史 深度學習是近十年來人工智能領域取得的重要突破。它在語音識別、自然語言處理、計算機視覺、圖像與視頻分析、多媒體等諸多領域的應用取得了巨大成功。現有的深度學習模型屬于神…

多個css樣式合并到一個“目錄”css文件中

執行訪問jsp后發現沒有效果 同樣的代碼,在html中效果對比如下: 具體原因:不清楚,暫時記著~~~在jsp中不支持import這種css樣式的引用 轉載于:https://www.cnblogs.com/mangwusuozhi/p/10050108.html

Git 學習筆記之 merge

Merge: 1、Fast-forward(快進式) 2、recursice strategy (策略合并,三方合并) Fast-forward 策略合并 //創建一個文件夾,并初始化 Git mkdir GitDemo cd GitDemo git init//初次提交,創建 master 分支 touch master.tx…

熊貓直播 使用什么sdk_沒什么可花的-但是16項基本操作才能讓您開始使用熊貓

熊貓直播 使用什么sdkPython has become the go-to programming language for many data scientists and machine learning researchers. One essential data processing tool for them to make this choice is the pandas library. For sure, the pandas library is so versat…

萌新一手包App前后端開發日記(一)

從事Android移動端也有些日子了,還記得一開始選擇這份工作,是憧憬著有朝一日能讓親朋好友用上自己開發的軟件,但日子久了才發現,并不是所有的公司,所有的項目的適用群體都是“親朋好友”,/無奈臉 攤手。當…

方差,協方差 、統計學的基本概念

一、統計學的基本概念 統計學里最基本的概念就是樣本的均值、方差、標準差。首先,我們給定一個含有n個樣本的集合,下面給出這些概念的公式描述: 均值: 標準差: 方差: 均值描述的是樣本集合的中間點&#xf…

關系型數據庫的核心單元是_核中的數據關系

關系型數據庫的核心單元是Nucleoid is an open source (Apache 2.0), a runtime environment that provides logical integrity in declarative programming, and at the same time, it stores declarative statements so that it doesn’t require external database, in shor…

MongoDB第二天

集合的操作: db.表名稱 show tables / collection db.表名.drop() 文檔的操作: 插入數據 db.表名.insert({"name":"jerry"}) db.insertMany([{"name":"sb",...}]) var ul {"name":"sb"} db.sb.insert(ul) db.sb.…