Posts

Showing posts from February 17, 2019

How can I define two-way tree structure in Rust? [duplicate]

Image
0 This question already has an answer here: How do I express mutually recursive data structures in safe Rust? 3 answers How to model complex recursive data structures (graphs)? 1 answer I mean a tree where every node has multiple children and every child refers back to its parent. I've got this far: pub struct Post { content: String, links: Vec<Post>, parent: Box<Post>, } impl Post { pub fn new() -> Post { Post { content: String::new(), links: Vec::new(), parent: Box::new(......), } } } What do I put in the place

Find the cardinality of set ${(x,y,z):x,y,z in mathbb{Z}^+ wedge xyz=108}$

Image
0 $begingroup$ Find the cardinality of set ${(x,y,z): x,y,ztext{ are positive integers and }xyz=108}$ my attempt: I write all factors of $108$ . $$1,2,3,4,6,9,12,18,27,36,54,108.$$ First observe that $xyz $ has only two degree of freedom. So its enough to choose $x,y$ . If I choose $x=1$ there are $12$ ways of choosing $y$ . If choose $x$ as $2$ there are $11$ ways ...and so on. So total number of ways $=1+2+...12=78$ . But its give in my book that $60$ is answer. Where am I wrong? combinatorics permutations combinations integers share | cite | improve this question edited Jan 15 at 7:52 David G.